Improve error handling for IdempotentParamaterMismatch (#30324)

Ensure all the return variables are correctly populated
and return more info in the error message
This commit is contained in:
Will Thames 2017-09-21 06:42:13 +10:00 committed by ansibot
commit 685267df73

View file

@ -707,13 +707,13 @@ def create(client, subnet_id, allocation_id, client_token=None,
except botocore.exceptions.ClientError as e: except botocore.exceptions.ClientError as e:
if "IdempotentParameterMismatch" in e.message: if "IdempotentParameterMismatch" in e.message:
err_msg = ( err_msg = (
'NAT Gateway does not support update and token has already been provided' 'NAT Gateway does not support update and token has already been provided: ' + str(e)
) )
else: else:
err_msg = str(e) err_msg = str(e)
success = False success = False
changed = False changed = False
result = None result = None
return success, changed, err_msg, result return success, changed, err_msg, result