Permalink
Browse files

Fix threading for start_instances()

  • Loading branch information...
1 parent dd90c5f commit a0c393002713ae804710811ed63cde3a162ea27d @zmillman zmillman committed Jan 20, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/rubber/recipes/rubber/instances.rb
View
10 lib/rubber/recipes/rubber/instances.rb
@@ -496,15 +496,15 @@ def start_instances(aliases)
if instance_items.size == 0
fatal "No instances to start!"
else
- human_instance_list = instance_items.collect{|instance_item| "#{instance_item.name} (instance_item.instance_id)"}.join(', ')
+ human_instance_list = instance_items.collect{|instance_item| "#{instance_item.name} (#{instance_item.instance_id})"}.join(', ')
value = Capistrano::CLI.ui.ask("About to START #{human_instance_list} in mode #{Rubber.env}. Are you SURE [yes/NO]?: ")
fatal("Exiting", 0) if value != "yes"
instance_items.each do |instance_item|
- start_instance(instance_item.name)
-
- # Re-starting an instance will almost certainly give it a new set of IPs and DNS entries, so refresh the values.
start_threads << Thread.new do
+ start_instance(instance_item.name)
+
+ # Re-starting an instance will almost certainly give it a new set of IPs and DNS entries, so refresh the values.
while ! refresh_instance(instance_item.name)
sleep 1
end
@@ -517,7 +517,7 @@ def start_instances(aliases)
while true do
print "."
sleep 2
- break unless start_threads.any(&:alive?)
+ break unless start_threads.any?(&:alive?)
end
post_refresh

0 comments on commit a0c3930

Please sign in to comment.