mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Do not try to remove the main route table association
This commit is contained in:
parent
6f4ae56471
commit
0405e3701a
@ -967,7 +967,11 @@ def _subnets_present(route_table_name, subnet_ids=None, subnet_names=None, tags=
|
|||||||
assoc_ids = [x['subnet_id'] for x in route_table['associations']]
|
assoc_ids = [x['subnet_id'] for x in route_table['associations']]
|
||||||
|
|
||||||
to_create = [x for x in subnet_ids if x not in assoc_ids]
|
to_create = [x for x in subnet_ids if x not in assoc_ids]
|
||||||
to_delete = [x['id'] for x in route_table['associations'] if x['subnet_id'] not in subnet_ids]
|
to_delete = []
|
||||||
|
for x in route_table['associations']:
|
||||||
|
# Don't remove the main route table association
|
||||||
|
if x['subnet_id'] not in subnet_ids and x['subnet_id'] is not None:
|
||||||
|
to_delete.append(x['id'])
|
||||||
|
|
||||||
if to_create or to_delete:
|
if to_create or to_delete:
|
||||||
if __opts__['test']:
|
if __opts__['test']:
|
||||||
|
Loading…
Reference in New Issue
Block a user