diff --git a/cloud/amazon/ec2_vpc_nat_gateway.py b/cloud/amazon/ec2_vpc_nat_gateway.py index 25b9438..9372bc5 100644 --- a/cloud/amazon/ec2_vpc_nat_gateway.py +++ b/cloud/amazon/ec2_vpc_nat_gateway.py @@ -655,7 +655,7 @@ def release_address(client, allocation_id, check_mode=False): """ err_msg = '' if check_mode: - return True + return True, '' ip_released = False params = { @@ -977,13 +977,13 @@ def remove(client, nat_gateway_id, wait=False, wait_timeout=0, err_msg = str(e) if release_eip: - eip_released, err = ( - release_address(client, allocation_id, check_mode=check_mode) + eip_released, eip_err = ( + release_address(client, allocation_id, check_mode) ) if not eip_released: err_msg = ( "{0}: Failed to release EIP {1}: {2}" - .format(err_msg, allocation_id, err) + .format(err_msg, allocation_id, eip_err) ) success = False