lib/zergrush_cf/init.rb in zergrush_cf-0.0.7 vs lib/zergrush_cf/init.rb in zergrush_cf-0.0.8
- old
+ new
@@ -122,17 +122,22 @@
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))
+ logRabbitEvents(events.first(events.length - event_counter), rabbit_objects, eval_params(task_hash["vm"]["driver"]["driveroptions"][0]["rabbit"]))
puts("Stack outputs:")
ap outputs_info.body["Stacks"][0]["Outputs"]
rabbit_objects[:connection].close unless rabbit_objects == nil
return 0
end
end
+ # log the remaining events for failure case
+ 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"]))
+
rabbit_objects[:connection].close unless rabbit_objects == nil
abort("ERROR: Failed with stack status: #{outputs_info.body["Stacks"][0]["StackStatus"]}")
rescue Fog::Errors::Error => fog_cf_error
rabbit_objects[:connection].close unless rabbit_objects == nil
@@ -203,13 +208,18 @@
begin
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))
+ logRabbitEvents(events.first(events.length - event_counter), rabbit_objects, eval_params(task_hash["vm"]["driver"]["driveroptions"][0]["rabbit"]))
rabbit_objects[:connection].close unless rabbit_objects == nil
return 0
end
end
+
+ # log remaining events for error case
+ 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"]))
rabbit_objects[:connection].close unless rabbit_objects == nil
abort("ERROR: Failed with stack status: #{outputs_info.body["Stacks"][0]["StackStatus"]}")
rescue Fog::Errors::Error => fog_cf_error