Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[exec/clean-ec2-cruft] More robust and 1.9 compatability fixes

  • Loading branch information...
commit 3526854e7d3d9411110f7d2d9d83bf9bfc1e5f81 1 parent e01cd5f
Steven Danna authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 exec/clean-ec2-cruft.rb
16 exec/clean-ec2-cruft.rb
View
@@ -26,18 +26,18 @@ def clean()
ec2_id_list.compact!
#Filter active EC2 instances from node list
- nodes_to_clean = nodes_to_clean.select { |n| ec2_id_list.all?{ |s| s != n.ec2.instance_id}}
+ nodes_to_clean = nodes_to_clean.select { |n| ec2_id_list.all?{ |s| n['ec2']['instance_id'] && s != n['ec2']['instance_id']}}
#Get corresponding clients
clients_to_clean = nodes_to_clean.map { |n| clients.show(n.name) }
#Confirm with User
- puts "Nodes For Deletion:"
- puts nodes_to_clean
- puts "-"*6
- puts "Clients for Deletion:"
- puts clients_to_clean
- puts "-"*6
+ ui.msg "Nodes For Deletion:"
+ pp nodes_to_clean
+ ui.msg "-"*6
+ ui.msg "Clients for Deletion:"
+ pp clients_to_clean
+ ui.msg "-"*6
ui.confirm("Do you want to delete these objects")
# Delete!
@@ -49,4 +49,4 @@ def clean()
c = Cleanup.new
c.clean
-exit 0
+exit 0
Please sign in to comment.
Something went wrong with that request. Please try again.