From ab62c644bc9f91f025b7e77480b0258d55bbb307 Mon Sep 17 00:00:00 2001 From: Allen Sanabria Date: Mon, 25 Jul 2016 14:19:35 -0700 Subject: updated catch statement to pass test (as e) --- cloud/amazon/ec2_vpc_nat_gateway.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cloud/amazon/ec2_vpc_nat_gateway.py b/cloud/amazon/ec2_vpc_nat_gateway.py index 1b574840..1364aa78 100644 --- a/cloud/amazon/ec2_vpc_nat_gateway.py +++ b/cloud/amazon/ec2_vpc_nat_gateway.py @@ -376,7 +376,7 @@ def get_nat_gateways(client, subnet_id=None, nat_gateway_id=None, existing_gateways = DRY_RUN_GATEWAYS err_msg = '{0} Retrieving gateways'.format(DRY_RUN_MSGS) - except botocore.exceptions.ClientError, e: + except botocore.exceptions.ClientError as e: err_msg = str(e) return gateways_retrieved, err_msg, existing_gateways @@ -457,7 +457,7 @@ def wait_for_status(client, wait_timeout, nat_gateway_id, status, else: time.sleep(polling_increment_secs) - except botocore.exceptions.ClientError, e: + except botocore.exceptions.ClientError as e: err_msg = str(e) if not status_achieved: @@ -578,7 +578,7 @@ def get_eip_allocation_id_by_address(client, eip_address, check_mode=False): "EIP {0} does not exist".format(eip_address) ) - except botocore.exceptions.ClientError, e: + except botocore.exceptions.ClientError as e: err_msg = str(e) return allocation_id, err_msg @@ -618,7 +618,7 @@ def allocate_eip_address(client, check_mode=False): ip_allocated = True err_msg = 'eipalloc id {0} created'.format(new_eip) - except botocore.exceptions.ClientError, e: + except botocore.exceptions.ClientError as e: err_msg = str(e) return ip_allocated, err_msg, new_eip @@ -1022,7 +1022,7 @@ def main(): region=region, endpoint=ec2_url, **aws_connect_kwargs ) ) - except botocore.exceptions.ClientError, e: + except botocore.exceptions.ClientError as e: module.fail_json(msg="Boto3 Client Error - " + str(e.msg)) changed = False -- cgit v1.2.1