- 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.
This commit is contained in:
Avishay Bar 2019-07-04 02:35:56 +03:00 committed by Will Thames
parent 9808ffecc7
commit 89be328a29

View file

@ -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: