From 685267df73afa54323931508626e880aa1ace795 Mon Sep 17 00:00:00 2001 From: Will Thames Date: Thu, 21 Sep 2017 06:42:13 +1000 Subject: [PATCH] Improve error handling for IdempotentParamaterMismatch (#30324) Ensure all the return variables are correctly populated and return more info in the error message --- lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py index d5167726c3..b96ecbbb20 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py @@ -707,13 +707,13 @@ def create(client, subnet_id, allocation_id, client_token=None, except botocore.exceptions.ClientError as e: if "IdempotentParameterMismatch" in e.message: 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: err_msg = str(e) - success = False - changed = False - result = None + success = False + changed = False + result = None return success, changed, err_msg, result