Fix for routers without external interfaces

pull/18777/head
David Shrewsbury 9 years ago committed by Matt Clay
parent c2b695390b
commit f086279a23

@ -164,10 +164,13 @@ def _needs_update(cloud, module, router, network, internal_subnet_ids):
""" """
if router['admin_state_up'] != module.params['admin_state_up']: if router['admin_state_up'] != module.params['admin_state_up']:
return True return True
if router['external_gateway_info'].get('enable_snat', True) != module.params['enable_snat']: if router['external_gateway_info']:
return True if router['external_gateway_info'].get('enable_snat', True) != module.params['enable_snat']:
return True
if network: 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 return True
# check external interfaces # check external interfaces

Loading…
Cancel
Save