[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
This commit is contained in:
Will Thames 2017-04-04 22:29:48 +10:00 committed by Ryan Brown
parent 1a1e12cf46
commit e61be9ea78
2 changed files with 3 additions and 5 deletions

View file

@ -113,7 +113,7 @@ except ImportError:
def get_internet_gateway_info(internet_gateway): def get_internet_gateway_info(internet_gateway):
internet_gateway_info = {'InternetGatewayId': internet_gateway['InternetGatewayId'], internet_gateway_info = {'InternetGatewayId': internet_gateway['InternetGatewayId'],
'Attachments': internet_gateway['Attachments'], 'Attachments': internet_gateway['Attachments'],
'Tags': internet_gateway['Tags'] } 'Tags': internet_gateway['Tags']}
return internet_gateway_info return internet_gateway_info
@ -121,7 +121,6 @@ def list_internet_gateways(client, module):
params = dict() params = dict()
params['Filters'] = ansible_dict_to_boto3_filter_list(module.params.get('filters')) params['Filters'] = ansible_dict_to_boto3_filter_list(module.params.get('filters'))
params['DryRun'] = module.check_mode
if module.params.get("internet_gateway_ids"): if module.params.get("internet_gateway_ids"):
params['InternetGatewayIds'] = 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 = ec2_argument_spec()
argument_spec.update( argument_spec.update(
dict( dict(
filters = dict(type='dict', default=dict()), filters=dict(type='dict', default=dict()),
internet_gateway_ids = dict(type='list', default=None) internet_gateway_ids=dict(type='list', default=None)
) )
) )

View file

@ -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.py
lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options_facts.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.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.py
lib/ansible/modules/cloud/amazon/ec2_vpc_nacl_facts.py lib/ansible/modules/cloud/amazon/ec2_vpc_nacl_facts.py
lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py