Skip LSP host info update for trunk subports
In ML2/OVN, the subports bindings are not updated with the host
information. This patch skips the LSP update in that case.
Currently the method ``update_lsp_host_info`` is stuck executing
``_wait_for_port_bindings_host``. During this time the subport
can be deleted or removed from the trunk. That will clash with
the newer operation that tries to remove the LSP port host info
and is the cause of the related bug.
Closes-Bug: #2085462
Change-Id: Ic68f9b5aa3b06bc4e1cbfbe577efc33b4b617b45
(cherry picked from commit 63d14a3ff2
)
This commit is contained in:
parent
32ef705e5b
commit
796f3a6080
@ -33,6 +33,7 @@ from neutron_lib.plugins import directory
|
|||||||
from neutron_lib.plugins import utils as p_utils
|
from neutron_lib.plugins import utils as p_utils
|
||||||
from neutron_lib.services.logapi import constants as log_const
|
from neutron_lib.services.logapi import constants as log_const
|
||||||
from neutron_lib.services.qos import constants as qos_consts
|
from neutron_lib.services.qos import constants as qos_consts
|
||||||
|
from neutron_lib.services.trunk import constants as trunk_const
|
||||||
from neutron_lib.utils import helpers
|
from neutron_lib.utils import helpers
|
||||||
from neutron_lib.utils import net as n_net
|
from neutron_lib.utils import net as n_net
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
@ -292,6 +293,10 @@ class OVNClient(object):
|
|||||||
Defaults to True.
|
Defaults to True.
|
||||||
"""
|
"""
|
||||||
cmd = []
|
cmd = []
|
||||||
|
if db_port.device_owner == trunk_const.TRUNK_SUBPORT_OWNER:
|
||||||
|
# NOTE(ralonsoh): OVN subports don't have host ID information.
|
||||||
|
return
|
||||||
|
|
||||||
if up:
|
if up:
|
||||||
if not db_port.port_bindings:
|
if not db_port.port_bindings:
|
||||||
return
|
return
|
||||||
|
@ -27,6 +27,7 @@ from neutron.tests.unit.services.logapi.drivers.ovn \
|
|||||||
from neutron_lib.api.definitions import l3
|
from neutron_lib.api.definitions import l3
|
||||||
from neutron_lib import constants as const
|
from neutron_lib import constants as const
|
||||||
from neutron_lib.services.logapi import constants as log_const
|
from neutron_lib.services.logapi import constants as log_const
|
||||||
|
from neutron_lib.services.trunk import constants as trunk_const
|
||||||
|
|
||||||
from tenacity import wait_none
|
from tenacity import wait_none
|
||||||
|
|
||||||
@ -251,6 +252,15 @@ class TestOVNClient(TestOVNClientBase):
|
|||||||
'Logical_Switch_Port', port_id, 'external_ids',
|
'Logical_Switch_Port', port_id, 'external_ids',
|
||||||
constants.OVN_HOST_ID_EXT_ID_KEY, if_exists=True)
|
constants.OVN_HOST_ID_EXT_ID_KEY, if_exists=True)
|
||||||
|
|
||||||
|
def test_update_lsp_host_info_trunk_subport(self):
|
||||||
|
context = mock.MagicMock()
|
||||||
|
db_port = mock.Mock(id='fake-port-id',
|
||||||
|
device_owner=trunk_const.TRUNK_SUBPORT_OWNER)
|
||||||
|
|
||||||
|
self.ovn_client.update_lsp_host_info(context, db_port)
|
||||||
|
self.nb_idl.db_remove.assert_not_called()
|
||||||
|
self.nb_idl.db_set.assert_not_called()
|
||||||
|
|
||||||
@mock.patch.object(ml2_db, 'get_port')
|
@mock.patch.object(ml2_db, 'get_port')
|
||||||
def test__wait_for_port_bindings_host(self, mock_get_port):
|
def test__wait_for_port_bindings_host(self, mock_get_port):
|
||||||
context = mock.MagicMock()
|
context = mock.MagicMock()
|
||||||
|
Loading…
Reference in New Issue
Block a user