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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/aws_cleaner.rb +12 -6
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6116869f6f0b2bfb0001c2273dd52a5b74727991
4
- data.tar.gz: 283ce83a3765d2049e5f46cc4f973e025427cd48
3
+ metadata.gz: 16fb8dddd4f3797a0bd15892381a32196094d0bd
4
+ data.tar.gz: b4035248aab35a0d328504fb7eaaa429a92d64cc
5
5
  SHA512:
6
- metadata.gz: 0ddacb13b71c9394bbfbbc34cb9ef8924ef7c1846d32725edb3dfbef1b121d0abb68cf19652ea2129c278161033537721aef5a78099012d6f68d9cee29ab06db
7
- data.tar.gz: d5a21afb386566bbe6985b91a8965491f31241fa84d85401e1add33c1aff34a083513f9a8da43c55926b2e12a6f372a54d4e33d9aa2fd738e4f43e9d419df5e1
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 RestClient::Exception => e
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
- client = @chef.clients.fetch(node_name)
113
- client.destroy
114
- node = @chef.nodes.fetch(node_name)
115
- node.destroy
116
- notify_hipchat('Removed ' + node_name + ' from Chef')
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.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-30 00:00:00.000000000 Z
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 nodes are terminated
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 nodes are terminated
114
+ summary: AWS Cleaner cleans up after EC2 instances are terminated
115
115
  test_files: []