aws-cleaner 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/aws_cleaner.rb +12 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16fb8dddd4f3797a0bd15892381a32196094d0bd
|
4
|
+
data.tar.gz: b4035248aab35a0d328504fb7eaaa429a92d64cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0df807abd32212c1dd95bccadfa672006ffe0e4e920c95e13bcdeda41649fe201f21d7e4182ce233a02d3dff4a8305812d087778d9c613fd7d4c002dab6bca04
|
7
|
+
data.tar.gz: c55ffa8a0079f4cbc81ee570fbb80e06f42eeb72f97b47773d4ed3c0c4d36b353d00a543501d222bec3929aea1b653d053c1f194fb2a32552309f0958497bf86
|
data/bin/aws_cleaner.rb
CHANGED
@@ -87,7 +87,7 @@ def in_sensu?(node_name)
|
|
87
87
|
RestClient.get("#{@config[:sensu][:url]}/clients/#{node_name}")
|
88
88
|
rescue RestClient::ResourceNotFound
|
89
89
|
return false
|
90
|
-
rescue
|
90
|
+
rescue => e
|
91
91
|
puts "Sensu request failed: #{e}"
|
92
92
|
return false
|
93
93
|
else
|
@@ -108,12 +108,18 @@ def remove_from_sensu(node_name)
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
+
# call the Chef API to remove the node
|
111
112
|
def remove_from_chef(node_name)
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
113
|
+
begin
|
114
|
+
client = @chef.clients.fetch(node_name)
|
115
|
+
client.destroy
|
116
|
+
node = @chef.nodes.fetch(node_name)
|
117
|
+
node.destroy
|
118
|
+
rescue => e
|
119
|
+
puts "Failed to remove chef node: #{e}"
|
120
|
+
else
|
121
|
+
notify_hipchat('Removed ' + node_name + ' from Chef') if @config[:hipchat][:enable]
|
122
|
+
end
|
117
123
|
end
|
118
124
|
|
119
125
|
def notify_hipchat(msg)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-cleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Heydrick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.1'
|
83
|
-
description: AWS Cleaner cleans up after EC2
|
83
|
+
description: AWS Cleaner cleans up after EC2 instances are terminated
|
84
84
|
email: eheydrick@gmail.com
|
85
85
|
executables:
|
86
86
|
- aws_cleaner.rb
|
@@ -111,5 +111,5 @@ rubyforge_project:
|
|
111
111
|
rubygems_version: 2.0.14
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
|
-
summary: AWS Cleaner cleans up after EC2
|
114
|
+
summary: AWS Cleaner cleans up after EC2 instances are terminated
|
115
115
|
test_files: []
|