Ensure LB are removed from LS not connected to the LB LR
Once the logical_switch (neutron subnet) is removed from the logical_router (neutron router) where the OVN-LB VIP and members are connected to, there is no need to keep the LB added to that logical_switch Closes-Bug: #1992356 Change-Id: I86aba3eee88b3da3cae7b57da2eabc6c3cb5d953
This commit is contained in:
@@ -599,7 +599,10 @@ class OvnProviderHelper():
|
||||
ovn_ls.uuid, ovn_lb.uuid, may_exist=True))
|
||||
else:
|
||||
if ls_name not in ls_refs:
|
||||
# Nothing to be done.
|
||||
if ovn_ls:
|
||||
commands.append(self.ovn_nbdb_api.ls_lb_del(
|
||||
ovn_ls.uuid, ovn_lb.uuid, if_exists=True))
|
||||
# Nothing else to be done.
|
||||
return commands
|
||||
|
||||
ref_ct = ls_refs[ls_name]
|
||||
|
||||
@@ -2716,7 +2716,8 @@ class TestOvnProviderHelper(ovn_base.TestOvnOctaviaBase):
|
||||
self.helper.ovn_nbdb_api.ls_get.assert_called_once_with(
|
||||
'neutron-foo')
|
||||
self.helper.ovn_nbdb_api.db_set.assert_not_called()
|
||||
self.helper.ovn_nbdb_api.ls_lb_del.assert_not_called()
|
||||
self.helper.ovn_nbdb_api.ls_lb_del.assert_called_once_with(
|
||||
self.network.uuid, self.ref_lb1.uuid, if_exists=True)
|
||||
|
||||
def test__update_lb_to_ls_association_net_ls_ref_wrong_format(self):
|
||||
self._update_lb_to_ls_association.stop()
|
||||
|
||||
Reference in New Issue
Block a user