Merge "[stable only] Do not fail on missing logical router ports" into stable/2024.1

This commit is contained in:
Zuul 2024-05-29 10:27:45 +00:00 committed by Gerrit Code Review
commit f70ef2c23c
4 changed files with 5 additions and 5 deletions

View File

@ -2058,7 +2058,8 @@ class OVNClient(object):
for port in ports: for port in ports:
lrp_name = utils.ovn_lrouter_port_name(port['id']) lrp_name = utils.ovn_lrouter_port_name(port['id'])
options = self._gen_router_port_options(port, prov_net) options = self._gen_router_port_options(port, prov_net)
commands.append(self._nb_idl.lrp_set_options(lrp_name, **options)) commands.append(self._nb_idl.update_lrouter_port(
lrp_name, if_exists=True, **options))
self._transaction(commands, txn=txn) self._transaction(commands, txn=txn)
def _check_network_changes_in_ha_chassis_groups(self, def _check_network_changes_in_ha_chassis_groups(self,

View File

@ -63,7 +63,6 @@ class FakeOvsdbNbOvnIdl(object):
self.delete_lswitch_port = mock.Mock() self.delete_lswitch_port = mock.Mock()
self.get_acls_for_lswitches = mock.Mock() self.get_acls_for_lswitches = mock.Mock()
self.lrp_del = mock.Mock() self.lrp_del = mock.Mock()
self.lrp_set_options = mock.Mock()
self.lr_add = mock.Mock() self.lr_add = mock.Mock()
self.update_lrouter = mock.Mock() self.update_lrouter = mock.Mock()
self.lr_del = mock.Mock() self.lr_del = mock.Mock()

View File

@ -2573,8 +2573,8 @@ class TestOVNMechanismDriver(TestOVNMechanismDriverBase):
self.mech_driver.update_network_postcommit(fake_ctx) self.mech_driver.update_network_postcommit(fake_ctx)
lrp_name = ovn_utils.ovn_lrouter_port_name(port['port']['id']) lrp_name = ovn_utils.ovn_lrouter_port_name(port['port']['id'])
self.nb_ovn.lrp_set_options.assert_called_once_with( self.nb_ovn.update_lrouter_port.assert_called_once_with(
lrp_name, **expected_opts) lrp_name, if_exists=True, **expected_opts)
def test_update_network_need_to_frag_enabled(self): def test_update_network_need_to_frag_enabled(self):
ovn_conf.cfg.CONF.set_override('ovn_emit_need_to_frag', True, ovn_conf.cfg.CONF.set_override('ovn_emit_need_to_frag', True,

View File

@ -1987,7 +1987,7 @@ class TestOVNL3RouterPlugin(test_mech_driver.Ml2PluginV2TestCase):
self.l3_inst._nb_ovn.add_lrouter_port.assert_called_once_with( self.l3_inst._nb_ovn.add_lrouter_port.assert_called_once_with(
**fake_router_port_assert) **fake_router_port_assert)
# Since if_exists = True it will safely return # Since if_exists = True it will safely return
self.l3_inst._nb_ovn.lrp_set_options( self.l3_inst._nb_ovn.update_lrouter_port(
name='lrp-router-port-id', if_exists=True, name='lrp-router-port-id', if_exists=True,
options=fake_router_port_assert) options=fake_router_port_assert)
# If no if_exists is provided, it is defaulted to true, so this # If no if_exists is provided, it is defaulted to true, so this