From e61be9ea785f2288374fa32dcbff08d3acc8ac18 Mon Sep 17 00:00:00 2001 From: Will Thames Date: Tue, 4 Apr 2017 22:29:48 +1000 Subject: [PATCH] [cloud] Remove DryRun parameter in ec2_vpc_igw_facts check_mode (#23113) * Remove DryRun parameter in ec2_vpc_igw_facts check_mode Using DryRun in check mode causes errors, and is not required (as nothing changes when calling describe_internet_gateways) Prevents the following error: ``` {"changed": false, "failed": true, "msg": "An error occurred (DryRunOperation) when calling the DescribeInternetGateways operation: Request would have succeeded, but DryRun flag is set."} ``` * ec2_vpc_igw_facts pep8 tidy up --- lib/ansible/modules/cloud/amazon/ec2_vpc_igw_facts.py | 7 +++---- test/sanity/pep8/legacy-files.txt | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_igw_facts.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_igw_facts.py index 70e3056520a..a16c831c7b6 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_igw_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_igw_facts.py @@ -113,7 +113,7 @@ except ImportError: def get_internet_gateway_info(internet_gateway): internet_gateway_info = {'InternetGatewayId': internet_gateway['InternetGatewayId'], 'Attachments': internet_gateway['Attachments'], - 'Tags': internet_gateway['Tags'] } + 'Tags': internet_gateway['Tags']} return internet_gateway_info @@ -121,7 +121,6 @@ def list_internet_gateways(client, module): params = dict() params['Filters'] = ansible_dict_to_boto3_filter_list(module.params.get('filters')) - params['DryRun'] = module.check_mode if module.params.get("internet_gateway_ids"): params['InternetGatewayIds'] = module.params.get("internet_gateway_ids") @@ -141,8 +140,8 @@ def main(): argument_spec = ec2_argument_spec() argument_spec.update( dict( - filters = dict(type='dict', default=dict()), - internet_gateway_ids = dict(type='list', default=None) + filters=dict(type='dict', default=dict()), + internet_gateway_ids=dict(type='list', default=None) ) ) diff --git a/test/sanity/pep8/legacy-files.txt b/test/sanity/pep8/legacy-files.txt index 82c4b3ac606..94086d39701 100644 --- a/test/sanity/pep8/legacy-files.txt +++ b/test/sanity/pep8/legacy-files.txt @@ -176,7 +176,6 @@ lib/ansible/modules/cloud/amazon/ec2_vol_facts.py lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options.py lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options_facts.py lib/ansible/modules/cloud/amazon/ec2_vpc_igw.py -lib/ansible/modules/cloud/amazon/ec2_vpc_igw_facts.py lib/ansible/modules/cloud/amazon/ec2_vpc_nacl.py lib/ansible/modules/cloud/amazon/ec2_vpc_nacl_facts.py lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py