Skip to content

Commit

Permalink
[cloud] Log more exception info to fix sts_assume_role integration te…
Browse files Browse the repository at this point in the history
…sts (ansible#35570)
  • Loading branch information
s-hertel authored and ryansb committed Jan 31, 2018
1 parent 9dad5d6 commit 556bb7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/ansible/modules/cloud/amazon/iam_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,11 @@ def create_or_update_role(connection, module):
role = connection.create_role(**params)
changed = True
except ClientError as e:
module.fail_json(msg="Unable to create role", exception=traceback.format_exc(), **camel_dict_to_snake_dict(e.response))
module.fail_json(msg="Unable to create role: {0}".format(to_native(e)),
exception=traceback.format_exc(), **camel_dict_to_snake_dict(e.response))
except BotoCoreError as e:
module.fail_json(msg="Unable to create role", exception=traceback.format_exc())
module.fail_json(msg="Unable to create role: {0}".format(to_native(e)),
exception=traceback.format_exc())
else:
# Check Assumed Policy document
if not compare_assume_role_policy_doc(role['AssumeRolePolicyDocument'], params['AssumeRolePolicyDocument']):
Expand Down
1 change: 1 addition & 0 deletions test/integration/targets/sts_assume_role/aliases
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cloud/aws
posix/ci/cloud/group1/aws
iam_role

0 comments on commit 556bb7a

Please sign in to comment.