Use neutron-lib constants for agent mode

... instead of using hard-coded strings.

Change-Id: I65e7461bcc3111d7ba0a621bd993a52812a31bdc
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025-07-21 23:53:19 +09:00
parent 93b8fddf45
commit 8e164633ef

View File

@@ -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)