Backport amazon.aws/211 - use fail_json_aws instead of fail_json (already trying to pass exception) (#72772)

pull/72883/head
Mark Chappell 5 years ago committed by GitHub
parent aa471096de
commit 2cd72a98de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- ec2_group - Fixes error handling during tagging failures (https://github.com/ansible-collections/amazon.aws/issues/210).

@ -793,7 +793,7 @@ def update_tags(client, module, group_id, current_tags, tags, purge_tags):
try:
client.create_tags(Resources=[group_id], Tags=ansible_dict_to_boto3_tag_list(tags_need_modify))
except (BotoCoreError, ClientError) as e:
module.fail_json(e, msg="Unable to add tags {0}".format(tags_need_modify))
module.fail_json_aws(e, msg="Unable to add tags {0}".format(tags_need_modify))
return bool(tags_need_modify or tags_to_delete)

Loading…
Cancel
Save