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

ec2_snapshot_copy: WaitError and ClientError exception handling (#38072)

This commit is contained in:
Julien PRIGENT 2018-04-03 01:23:35 +01:00 committed by Will Thames
parent 67cd641c04
commit 70bcc5ed45

View file

@ -143,9 +143,9 @@ def copy_snapshot(module, ec2):
)
except WaiterError as we:
module.fail_json(msg='An error occurred (%s) waiting for the snapshot to become available. (%s)' % (we.message, we.reason))
module.fail_json(msg='An error occurred waiting for the snapshot to become available. (%s)' % str(we), exception=traceback.format_exc())
except ClientError as ce:
module.fail_json(msg=ce.message, exception=traceback.format_exc(), **camel_dict_to_snake_dict(ce.response))
module.fail_json(msg=str(ce), exception=traceback.format_exc(), **camel_dict_to_snake_dict(ce.response))
module.exit_json(changed=True, snapshot_id=snapshot_id)