From ec2b4999592a68cf1833082505548c15cda4a5b8 Mon Sep 17 00:00:00 2001 From: Allen Sanabria Date: Wed, 23 Mar 2016 09:00:04 -0700 Subject: [PATCH] Fixed the missing argument to get_eip_allocation_id_by_address --- .../modules/extras/cloud/amazon/ec2_vpc_nat_gateway.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/amazon/ec2_vpc_nat_gateway.py b/lib/ansible/modules/extras/cloud/amazon/ec2_vpc_nat_gateway.py index 9b1fb235a6..307a9646e5 100644 --- a/lib/ansible/modules/extras/cloud/amazon/ec2_vpc_nat_gateway.py +++ b/lib/ansible/modules/extras/cloud/amazon/ec2_vpc_nat_gateway.py @@ -681,7 +681,7 @@ def create(client, subnet_id, allocation_id, client_token=None, def pre_create(client, subnet_id, allocation_id=None, eip_address=None, if_exist_do_not_create=False, wait=False, wait_timeout=0, - client_token=None): + client_token=None, check_mode=False): """Create an Amazon NAT Gateway. Args: client (botocore.client.EC2): Boto3 client @@ -747,7 +747,11 @@ def pre_create(client, subnet_id, allocation_id=None, eip_address=None, elif eip_address or allocation_id: if eip_address and not allocation_id: - allocation_id = get_eip_allocation_id_by_address(client) + allocation_id = ( + get_eip_allocation_id_by_address( + client, eip_address, check_mode=check_mode + ) + ) existing_gateways, allocation_id_exists = ( gateway_in_subnet_exists(client, subnet_id, allocation_id)