1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Skip null id route tables when adding/deleting them in ec2_vpc

Fixes #8552
This commit is contained in:
James Cammarata 2014-09-23 14:51:56 -05:00
parent d1037635d6
commit 12c0378f78

View file

@ -451,6 +451,7 @@ def create_vpc(module, vpc_conn):
old_rt = vpc_conn.get_all_route_tables( old_rt = vpc_conn.get_all_route_tables(
filters={'association.subnet_id': rsn.id, 'vpc_id': vpc.id} filters={'association.subnet_id': rsn.id, 'vpc_id': vpc.id}
) )
old_rt = [ x for x in old_rt if x.id != None ]
if len(old_rt) == 1: if len(old_rt) == 1:
old_rt = old_rt[0] old_rt = old_rt[0]
association_id = None association_id = None
@ -474,6 +475,8 @@ def create_vpc(module, vpc_conn):
# table yet. # table yet.
all_rts = vpc_conn.get_all_route_tables(filters={'vpc-id': vpc.id}) all_rts = vpc_conn.get_all_route_tables(filters={'vpc-id': vpc.id})
for rt in all_rts: for rt in all_rts:
if rt.id is None:
continue
delete_rt = True delete_rt = True
for newrt in all_route_tables: for newrt in all_route_tables:
if newrt.id == rt.id: if newrt.id == rt.id: