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:
parent
d1037635d6
commit
12c0378f78
1 changed files with 3 additions and 0 deletions
|
@ -451,6 +451,7 @@ def create_vpc(module, vpc_conn):
|
|||
old_rt = vpc_conn.get_all_route_tables(
|
||||
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:
|
||||
old_rt = old_rt[0]
|
||||
association_id = None
|
||||
|
@ -474,6 +475,8 @@ def create_vpc(module, vpc_conn):
|
|||
# table yet.
|
||||
all_rts = vpc_conn.get_all_route_tables(filters={'vpc-id': vpc.id})
|
||||
for rt in all_rts:
|
||||
if rt.id is None:
|
||||
continue
|
||||
delete_rt = True
|
||||
for newrt in all_route_tables:
|
||||
if newrt.id == rt.id:
|
||||
|
|
Loading…
Reference in a new issue