mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
Add subnet associations to route tables dict
The main purpose of this PR is to add the subnet associations to the dict returned by ec2_vpc_route_table_facts. This commit also re-formats code to make it PEP8 compliant.
This commit is contained in:
parent
4bf7bf0b94
commit
90002e06ae
1 changed files with 11 additions and 6 deletions
|
@ -74,17 +74,22 @@ def get_route_table_info(route_table):
|
||||||
|
|
||||||
# Add any routes to array
|
# Add any routes to array
|
||||||
routes = []
|
routes = []
|
||||||
|
associations = []
|
||||||
for route in route_table.routes:
|
for route in route_table.routes:
|
||||||
routes.append(route.__dict__)
|
routes.append(route.__dict__)
|
||||||
|
for association in route_table.associations:
|
||||||
|
associations.append(association.__dict__)
|
||||||
|
|
||||||
route_table_info = {'id': route_table.id,
|
route_table_info = {'id': route_table.id,
|
||||||
'routes': routes,
|
'routes': routes,
|
||||||
|
'associations': associations,
|
||||||
'tags': route_table.tags,
|
'tags': route_table.tags,
|
||||||
'vpc_id': route_table.vpc_id
|
'vpc_id': route_table.vpc_id
|
||||||
}
|
}
|
||||||
|
|
||||||
return route_table_info
|
return route_table_info
|
||||||
|
|
||||||
|
|
||||||
def list_ec2_vpc_route_tables(connection, module):
|
def list_ec2_vpc_route_tables(connection, module):
|
||||||
|
|
||||||
filters = module.params.get("filters")
|
filters = module.params.get("filters")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue