knife-rackspace-load-balancer 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chef/knife/rackspace_load_balancer_delete_node.rb +15 -10
- data/lib/version.rb +1 -1
- metadata +1 -1
@@ -95,18 +95,23 @@ module KnifePlugins
|
|
95
95
|
end
|
96
96
|
|
97
97
|
target_load_balancers.each do |lb|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
98
|
+
begin
|
99
|
+
ui.output("Opening #{lb[:name]}")
|
100
|
+
balancer = lb_connection.get_load_balancer(lb[:id])
|
101
|
+
|
102
|
+
lb_nodes = balancer.list_nodes
|
103
|
+
lb_nodes.each do |lb_node_hash|
|
104
|
+
if node_ips.include? lb_node_hash[:address].to_s
|
105
|
+
lb_node = balancer.get_node(lb_node_hash[:id])
|
106
|
+
ui.output("Removing node #{lb_node.address}")
|
107
|
+
if lb_node.destroy!
|
108
|
+
ui.output(ui.color("Success", :green))
|
109
|
+
end
|
108
110
|
end
|
109
111
|
end
|
112
|
+
|
113
|
+
rescue CloudLB::Exception::Other => e
|
114
|
+
ui.error("Failed on #{lb[:name]}: CloudLB::Exception [#{e.class.name}] - #{e.message}")
|
110
115
|
end
|
111
116
|
end
|
112
117
|
|
data/lib/version.rb
CHANGED