[OVN] `HAChassisGroupRouterEvent` is for router HCG only

The event ``HAChassisGroupRouterEvent`` handles the ``HA_Chassis_Group``
registers created for routers, when the external network is tunnelled.
This event should only attend ``HA_Chassis_Group`` that have the key
"neutron:router_id" in the external_ids field, that identifies that is
created for routers only.

Closes-Bug: #2126588
Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
Change-Id: I4631094d7e2bfda9ddff5feb8c96960ea0cd436d
This commit is contained in:
Rodolfo Alonso Hernandez
2025-10-02 07:15:24 +00:00
committed by Rodolfo Alonso
parent a64afcb13a
commit d7e80423fd

View File

@@ -716,8 +716,10 @@ class HAChassisGroupRouterEvent(row_event.RowEvent):
self.event_name = 'HAChassisGroupRouterEvent'
def match_fn(self, event, row, old):
if (ovn_const.OVN_ROUTER_ID_EXT_ID_KEY in row.external_ids or
hasattr(old, 'ha_chassis')):
if ovn_const.OVN_ROUTER_ID_EXT_ID_KEY not in row.external_ids:
# This is not a router "HA_Chassis_Group".
return False
if hasattr(old, 'ha_chassis'):
# "HA_Chassis_Group" has been assigned to a router or there are
# changes in the "ha_chassis" list.
return True