Skip to content

Commit

Permalink
Python 3 compatibility error handling: use to_native(e) instead of st…
Browse files Browse the repository at this point in the history
…r(e) or e.me… (ansible-collections#26)

* Py3 compat error handling: use to_native(e) instead of str(e) or e.message
* PR comment changes, use fail_json_aws and is_boto3_error_code

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@ffe14f9
  • Loading branch information
veloutin authored and alinabuzachis committed Sep 22, 2023
1 parent 83eeff1 commit 9d7e252
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/modules/iam_mfa_device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def list_mfa_devices(connection, module):
try:
response = connection.list_mfa_devices(**args)
except ClientError as e:
module.fail_json(msg=e.message, **camel_dict_to_snake_dict(e.response))
module.fail_json_aws(e, msg="Failed to list MFA devices")

module.exit_json(changed=changed, **camel_dict_to_snake_dict(response))

Expand Down

0 comments on commit 9d7e252

Please sign in to comment.