From 556bb7ab004ff3dfe6aea5e937f0124cd81fffe2 Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Wed, 31 Jan 2018 13:18:09 -0500 Subject: [PATCH] [cloud] Log more exception info to fix sts_assume_role integration tests (#35570) --- lib/ansible/modules/cloud/amazon/iam_role.py | 6 ++++-- test/integration/targets/sts_assume_role/aliases | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/iam_role.py b/lib/ansible/modules/cloud/amazon/iam_role.py index 0ac77ded6d3..117fe8e0e75 100644 --- a/lib/ansible/modules/cloud/amazon/iam_role.py +++ b/lib/ansible/modules/cloud/amazon/iam_role.py @@ -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']): diff --git a/test/integration/targets/sts_assume_role/aliases b/test/integration/targets/sts_assume_role/aliases index ebdf4aa5720..b092d8ff09a 100644 --- a/test/integration/targets/sts_assume_role/aliases +++ b/test/integration/targets/sts_assume_role/aliases @@ -1,2 +1,3 @@ cloud/aws posix/ci/cloud/group1/aws +iam_role