lib/zergrush_cf/init.rb in zergrush_cf-0.0.10 vs lib/zergrush_cf/init.rb in zergrush_cf-0.0.11

- old
+ new

@@ -116,27 +116,27 @@ sleep 1 outputs_info = cf.describe_stacks({ 'StackName' => stack_name }) end events = nil - with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) { + with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::Errors::Error) { events = cf.describe_stack_events(stack_name).body['StackEvents'] } while events == nil do sleep 3 - with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) { + with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::Errors::Error) { events = cf.describe_stack_events(stack_name).body['StackEvents'] } end event_counter = 0 while outputs_info.body["Stacks"][0]["StackStatus"] == "CREATE_IN_PROGRESS" do logEvents(events.first(events.length - event_counter)) logRabbitEvents(events.first(events.length - event_counter), rabbit_objects, eval_params(task_hash["vm"]["driver"]["driveroptions"][0]["rabbit"])) event_counter = events.length - with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) { + with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::Errors::Error) { events = cf.describe_stack_events(stack_name).body['StackEvents'] } outputs_info = cf.describe_stacks({ 'StackName' => stack_name }) if outputs_info.body["Stacks"][0]["StackStatus"] == "CREATE_COMPLETE" logEvents(events.first(events.length - event_counter)) @@ -211,17 +211,17 @@ return 0 end end events = nil - with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) { + with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::Errors::Error) { events = cf.describe_stack_events(stack_name).body['StackEvents'] } while events == nil do sleep 3 begin - with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) { + with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::Errors::Error) { events = cf.describe_stack_events(stack_name).body['StackEvents'] } rescue Fog::AWS::CloudFormation::NotFound rabbit_objects[:connection].close unless rabbit_objects == nil return 0 @@ -233,10 +233,10 @@ logEvents(events.first(events.length - event_counter)) logRabbitEvents(events.first(events.length - event_counter), rabbit_objects, eval_params(task_hash["vm"]["driver"]["driveroptions"][0]["rabbit"])) event_counter = events.length begin - with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::AWS::CloudFormation::Error) { + with_retries(:max_tries => 10, :base_sleep_seconds => 3, :max_sleep_seconds => 20, :rescue => Fog::Errors::Error) { events = cf.describe_stack_events(stack_name).body['StackEvents'] } outputs_info = cf.describe_stacks({ 'StackName' => stack_name }) rescue Fog::AWS::CloudFormation::NotFound logEvents(events.first(events.length - event_counter))