From d8bf2a1cc5b130a7d0b720e16eb9325409af7251 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Sun, 9 Jan 2022 02:21:45 -0500 Subject: [PATCH] l3ha: fix status updates In the scenario of a failover, since the state is not updated, the router status remains as 'backup' in the agent and it skips on checking it's status. This patch updates the router info once there is updates to the HA state so that it can force a status update correctly. Change-Id: Id3ec0ec2517d0c8f09c558c25ceb53f7c9fdbcf5 --- neutron_vpnaas/services/vpn/agent.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neutron_vpnaas/services/vpn/agent.py b/neutron_vpnaas/services/vpn/agent.py index 4b85ba294..86810aeaa 100644 --- a/neutron_vpnaas/services/vpn/agent.py +++ b/neutron_vpnaas/services/vpn/agent.py @@ -88,6 +88,10 @@ class VPNAgent(l3_extension.L3AgentExtension): state = data['state'] for device_driver in self.device_drivers: if router_id in device_driver.processes: + # NOTE(mnaser): We need to update the router object so it has + # the new HA state so we can do status updates. + device_driver.routers[router_id].ha_state = state + process = device_driver.processes[router_id] if state in ('master', 'primary'): process.enable()