Merge "Fix _notify_l3_agent_port_update when there is no binding host"

This commit is contained in:
Zuul 2020-03-15 03:13:52 +00:00 committed by Gerrit Code Review
commit fefd9a6bb1
2 changed files with 7 additions and 7 deletions

View File

@ -549,14 +549,14 @@ def _notify_l3_agent_port_update(resource, event, trigger, **kwargs):
if new_port and original_port: if new_port and original_port:
l3plugin = directory.get_plugin(plugin_constants.L3) l3plugin = directory.get_plugin(plugin_constants.L3)
context = kwargs['context'] context = kwargs['context']
new_port_host = new_port.get(portbindings.HOST_ID)
original_port_host = original_port.get(portbindings.HOST_ID)
is_new_port_binding_changed = ( is_new_port_binding_changed = (
new_port[portbindings.HOST_ID] and new_port_host and
new_port[portbindings.HOST_ID] != new_port_host != original_port_host)
original_port[portbindings.HOST_ID])
is_bound_port_moved = ( is_bound_port_moved = (
original_port[portbindings.HOST_ID] and original_port_host and
original_port[portbindings.HOST_ID] != original_port_host != new_port_host)
new_port[portbindings.HOST_ID])
fip_router_id = None fip_router_id = None
dest_host = None dest_host = None
new_port_profile = new_port.get(portbindings.PROFILE) new_port_profile = new_port.get(portbindings.PROFILE)

View File

@ -59,7 +59,7 @@ def _notify_l3_agent_ha_port_update(resource, event, trigger, **kwargs):
new_port = kwargs.get('port') new_port = kwargs.get('port')
original_port = kwargs.get('original_port') original_port = kwargs.get('original_port')
context = kwargs.get('context') context = kwargs.get('context')
host = new_port[portbindings.HOST_ID] host = new_port.get(portbindings.HOST_ID)
if new_port and original_port and host: if new_port and original_port and host:
new_device_owner = new_port.get('device_owner', '') new_device_owner = new_port.get('device_owner', '')