Browse Source

Merge "[OVN] HA Chassis Group: Ignore UPDATES when external_ids hasn't changed"

tags/16.0.0.0rc1
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
6d0b8890b9
2 changed files with 14 additions and 0 deletions
  1. +5
    -0
      neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py
  2. +9
    -0
      neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovsdb_monitor.py

+ 5
- 0
neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py View File

@@ -82,6 +82,11 @@ class ChassisEvent(row_event.RowEvent):
if not self.driver._ovn_client.is_external_ports_supported():
return

# NOTE(lucasgomes): If the external_ids column wasn't updated
# (meaning, Chassis "gateway" status didn't change) just returns
if not hasattr(old, 'external_ids') and event == self.ROW_UPDATE:
return

is_gw_chassis = utils.is_gateway_chassis(row)
# If the Chassis being created is not a gateway, ignore it
if not is_gw_chassis and event == self.ROW_CREATE:


+ 9
- 0
neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovsdb_monitor.py View File

@@ -558,3 +558,12 @@ class TestChassisEvent(base.BaseTestCase):
# after it became a Gateway chassis
self._test_handle_ha_chassis_group_changes_create(
self.event.ROW_UPDATE)

def test_handle_ha_chassis_group_changes_update_ext_id_not_found(self):
self.is_gw_ch_mock.side_effect = (True, False)
old = fakes.FakeOvsdbTable.create_one_ovsdb_table(
attrs={'name': 'SpongeBob'})
self.assertIsNone(self.event.handle_ha_chassis_group_changes(
self.event.ROW_UPDATE, mock.Mock(), old))
self.assertFalse(self.nb_ovn.ha_chassis_group_add_chassis.called)
self.assertFalse(self.nb_ovn.ha_chassis_group_del_chassis.called)

Loading…
Cancel
Save