Skip to content

Commit

Permalink
[cloud] Support check_mode for ec2_vpc_subnet_facts (ansible#23111)
Browse files Browse the repository at this point in the history
* Support check_mode for ec2_vpc_subnet_facts

facts modules support check mode by default

* ec2_vpc_subnet_facts pep8 tidy up
  • Loading branch information
willthames authored and ryansb committed Apr 4, 2017
1 parent 2be64b8 commit bded5ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
25 changes: 13 additions & 12 deletions lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@

def get_subnet_info(subnet):

subnet_info = { 'id': subnet.id,
'availability_zone': subnet.availability_zone,
'available_ip_address_count': subnet.available_ip_address_count,
'cidr_block': subnet.cidr_block,
'default_for_az': subnet.defaultForAz,
'map_public_ip_on_launch': subnet.mapPublicIpOnLaunch,
'state': subnet.state,
'tags': subnet.tags,
'vpc_id': subnet.vpc_id
}
subnet_info = {'id': subnet.id,
'availability_zone': subnet.availability_zone,
'available_ip_address_count': subnet.available_ip_address_count,
'cidr_block': subnet.cidr_block,
'default_for_az': subnet.defaultForAz,
'map_public_ip_on_launch': subnet.mapPublicIpOnLaunch,
'state': subnet.state,
'tags': subnet.tags,
'vpc_id': subnet.vpc_id}

return subnet_info


def list_ec2_vpc_subnets(connection, module):

filters = module.params.get("filters")
Expand All @@ -123,11 +123,12 @@ def main():
argument_spec = ec2_argument_spec()
argument_spec.update(
dict(
filters = dict(default=None, type='dict')
filters=dict(default=None, type='dict')
)
)

module = AnsibleModule(argument_spec=argument_spec)
module = AnsibleModule(argument_spec=argument_spec,
supports_check_mode=True)

if not HAS_BOTO:
module.fail_json(msg='boto required for this module')
Expand Down
1 change: 0 additions & 1 deletion test/sanity/pep8/legacy-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ lib/ansible/modules/cloud/amazon/ec2_vpc_net.py
lib/ansible/modules/cloud/amazon/ec2_vpc_net_facts.py
lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py
lib/ansible/modules/cloud/amazon/ec2_vpc_subnet.py
lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py
lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py
lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py
lib/ansible/modules/cloud/amazon/ec2_win_password.py
Expand Down

0 comments on commit bded5ac

Please sign in to comment.