fog-prune 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,5 @@
1
+ # v0.1.2
2
+ * Add rackspace cross-reference support
3
+
1
4
  # v0.1.0
2
5
  * Initial release
@@ -180,7 +180,25 @@ class FogPrune
180
180
  end
181
181
 
182
182
  def rackspace_check(node)
183
- raise 'Not implemented'
183
+ rackspace_node = rackspace_nodes.detect do |n|
184
+ n.name == node.name &&
185
+ n.ipv4_address == node[:rackspace][:public_ipv4]
186
+ end
187
+ unless(rackspace_node)
188
+ debug "#{node.name} returned nil from rackspace"
189
+ else
190
+ debug "#{node.name} state on rackspace: #{rackspace_node.state}"
191
+ end
192
+ rackspace_node.nil? || rackspace_node.state == 'DELETED'
193
+ end
194
+
195
+ def rackspace_nodes
196
+ unless(@rackspace_nodes)
197
+ @rackspace_nodes = compute(:rackspace).map do |compute_con|
198
+ compute_con.servers.all
199
+ end.flatten
200
+ end
201
+ @rackspace_nodes
184
202
  end
185
203
 
186
204
  def debug(msg)
@@ -1,6 +1,3 @@
1
1
  class FogPrune
2
- class Version < Gem::Version
3
- end
4
-
5
- VERSION = Version.new('0.1.0')
2
+ VERSION = Gem::Version.new('0.1.2')
6
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-prune
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-15 00:00:00.000000000 Z
12
+ date: 2014-08-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef