Merge "Fix watcher logic for exposing OVN LB with the NB DB driver"
This commit is contained in:
commit
69ea9a96dc
@ -665,9 +665,8 @@ class OVNLBCreateEvent(base_watcher.OVNLBEvent):
|
||||
vip_fip = self._get_vip_fip(row)
|
||||
old_vip_fip = self._get_vip_fip(old)
|
||||
with _SYNC_STATE_LOCK.read_lock():
|
||||
if hasattr(old, 'external_ids'):
|
||||
if vip_fip and vip_fip != old_vip_fip:
|
||||
self.agent.expose_ovn_lb_fip(row)
|
||||
if hasattr(old, 'external_ids') and vip_fip != old_vip_fip:
|
||||
self.agent.expose_ovn_lb_fip(row)
|
||||
else:
|
||||
self.agent.expose_ovn_lb_vip(row)
|
||||
|
||||
|
@ -1198,7 +1198,7 @@ class TestOVNLBCreateEvent(test_base.TestCase):
|
||||
self.agent.expose_ovn_lb_vip.assert_called_once_with(row)
|
||||
self.agent.expose_ovn_lb_fip.assert_not_called()
|
||||
|
||||
def test_run_vip_added_extra_ext_id_info(self):
|
||||
def test_run_vip_added_router(self):
|
||||
row = utils.create_row(
|
||||
external_ids={
|
||||
constants.OVN_LB_LR_REF_EXT_ID_KEY: 'neutron-router1',
|
||||
@ -1208,13 +1208,12 @@ class TestOVNLBCreateEvent(test_base.TestCase):
|
||||
vips={'vip': 'member', 'fip': 'member'})
|
||||
old = utils.create_row(
|
||||
external_ids={
|
||||
constants.OVN_LB_LR_REF_EXT_ID_KEY: 'neutron-router1',
|
||||
constants.OVN_LB_VIP_FIP_EXT_ID_KEY: 'fip',
|
||||
constants.OVN_LS_NAME_EXT_ID_KEY: 'net1'})
|
||||
|
||||
self.event.run(None, row, old)
|
||||
|
||||
self.agent.expose_ovn_lb_vip.assert_not_called()
|
||||
self.agent.expose_ovn_lb_vip.assert_called_once_with(row)
|
||||
self.agent.expose_ovn_lb_fip.assert_not_called()
|
||||
|
||||
def test_run_fip(self):
|
||||
|
Loading…
Reference in New Issue
Block a user