From 89be328a296a9801694fada6f2c72254629050c7 Mon Sep 17 00:00:00 2001 From: Avishay Bar Date: Thu, 4 Jul 2019 02:35:56 +0300 Subject: [PATCH] - Fixed error handling on aws_kms (#58690) While alias creation failes, this PR fixes the requirement of passing 2 arguments for the `fail_json_aws` method. --- lib/ansible/modules/cloud/amazon/aws_kms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/aws_kms.py b/lib/ansible/modules/cloud/amazon/aws_kms.py index c9f3d5885da..5985cc4a118 100644 --- a/lib/ansible/modules/cloud/amazon/aws_kms.py +++ b/lib/ansible/modules/cloud/amazon/aws_kms.py @@ -595,7 +595,7 @@ def update_key(connection, module, key): connection.create_alias(KeyId=key_id, AliasName=alias) changed = True except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: - module.fail_json_aws(msg="Failed create key alias") + module.fail_json_aws(e, msg="Failed create key alias") if key['key_state'] == 'PendingDeletion': try: