Fix for routers without external interfaces
This commit is contained in:
parent
2e49d89be7
commit
5d73a9a4c5
1 changed files with 6 additions and 3 deletions
|
@ -164,10 +164,13 @@ def _needs_update(cloud, module, router, network, internal_subnet_ids):
|
|||
"""
|
||||
if router['admin_state_up'] != module.params['admin_state_up']:
|
||||
return True
|
||||
if router['external_gateway_info'].get('enable_snat', True) != module.params['enable_snat']:
|
||||
return True
|
||||
if router['external_gateway_info']:
|
||||
if router['external_gateway_info'].get('enable_snat', True) != module.params['enable_snat']:
|
||||
return True
|
||||
if network:
|
||||
if router['external_gateway_info']['network_id'] != network['id']:
|
||||
if not router['external_gateway_info']:
|
||||
return True
|
||||
elif router['external_gateway_info']['network_id'] != network['id']:
|
||||
return True
|
||||
|
||||
# check external interfaces
|
||||
|
|
Loading…
Reference in a new issue