From 8e164633ef26c46bffbaac8092e58f03145e189d Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 21 Jul 2025 23:53:19 +0900 Subject: [PATCH] Use neutron-lib constants for agent mode ... instead of using hard-coded strings. Change-Id: I65e7461bcc3111d7ba0a621bd993a52812a31bdc Signed-off-by: Takashi Kajinami --- neutron_vpnaas/services/vpn/service_drivers/base_ipsec.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/neutron_vpnaas/services/vpn/service_drivers/base_ipsec.py b/neutron_vpnaas/services/vpn/service_drivers/base_ipsec.py index 2261d7b7d..0ba062c1e 100644 --- a/neutron_vpnaas/services/vpn/service_drivers/base_ipsec.py +++ b/neutron_vpnaas/services/vpn/service_drivers/base_ipsec.py @@ -52,8 +52,10 @@ class IPsecVpnDriverCallBack: # right agent to deploy the vpn service. In the # case of distributed the vpn service should reside # only on a dvr_snat node. - agent_mode = agent_conf.get('agent_mode', 'legacy') - if not agent.admin_state_up or agent_mode == 'dvr': + agent_mode = agent_conf.get( + 'agent_mode', lib_constants.L3_AGENT_MODE_LEGACY) + if (not agent.admin_state_up or + agent_mode == lib_constants.L3_AGENT_MODE_DVR): return [] query = context.session.query(vpn_models.VPNService) query = query.join(vpn_models.IPsecSiteConnection)