1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

improve cloudformation failures (#27427)

This commit is contained in:
Sloane Hertel 2017-08-01 14:23:32 -04:00 committed by Chris Alfonso
parent a43af128cf
commit 61ebb89fe3

View file

@ -309,7 +309,7 @@ def create_stack(module, stack_params, cfn):
result = stack_operation(cfn, stack_params['StackName'], 'CREATE')
except Exception as err:
error_msg = boto_exception(err)
module.fail_json(msg=error_msg)
module.fail_json(msg="Failed to create stack {0}: {1}.".format(stack_params.get('StackName'), error_msg), exception=traceback.format_exc())
if not result:
module.fail_json(msg="empty result")
return result
@ -349,7 +349,7 @@ def create_changeset(module, stack_params, cfn):
if 'No updates are to be performed.' in error_msg:
result = dict(changed=False, output='Stack is already up-to-date.')
else:
module.fail_json(msg=error_msg)
module.fail_json(msg="Failed to create change set: {0}".format(error_msg), exception=traceback.format_exc())
if not result:
module.fail_json(msg="empty result")
@ -371,7 +371,7 @@ def update_stack(module, stack_params, cfn):
if 'No updates are to be performed.' in error_msg:
result = dict(changed=False, output='Stack is already up-to-date.')
else:
module.fail_json(msg=error_msg)
module.fail_json(msg="Failed to update stack {0}: {1}".format(stack_params.get('StackName'), error_msg), exception=traceback.format_exc())
if not result:
module.fail_json(msg="empty result")
return result