diff options
author | John Estabrook <jestabro@vyos.io> | 2024-08-08 14:24:00 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2024-08-12 11:57:36 -0500 |
commit | 5f23b7275564cfaa7c178d320868b5f5e86ae606 (patch) | |
tree | 20f790026245bfbb394ad77a2fbb5b5f9f42b709 /src/conf_mode/vpn_ipsec.py | |
parent | ba0f8dbdb2766a67b6715291ac08ad0eb1cf62b7 (diff) | |
download | vyos-1x-5f23b7275564cfaa7c178d320868b5f5e86ae606.tar.gz vyos-1x-5f23b7275564cfaa7c178d320868b5f5e86ae606.zip |
configverify: T6642: verify_interface_exists requires config_dict arg
The function verify_interface_exists requires a reference to the ambient
config_dict rather than creating an instance. As access is required to
the 'interfaces' path, provide as attribute of class ConfigDict, so as
not to confuse path searches of script-specific config_dict instances.
Diffstat (limited to 'src/conf_mode/vpn_ipsec.py')
-rwxr-xr-x | src/conf_mode/vpn_ipsec.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/vpn_ipsec.py b/src/conf_mode/vpn_ipsec.py index b3e05a814..ca0c3657f 100755 --- a/src/conf_mode/vpn_ipsec.py +++ b/src/conf_mode/vpn_ipsec.py @@ -210,9 +210,9 @@ def verify(ipsec): for interface in ipsec['interface']: # exclude check interface for dynamic interfaces if tmp.match(interface): - verify_interface_exists(interface, warning_only=True) + verify_interface_exists(ipsec, interface, warning_only=True) else: - verify_interface_exists(interface) + verify_interface_exists(ipsec, interface) if 'l2tp' in ipsec: if 'esp_group' in ipsec['l2tp']: @@ -273,7 +273,7 @@ def verify(ipsec): if 'dhcp_interface' in ra_conf: dhcp_interface = ra_conf['dhcp_interface'] - verify_interface_exists(dhcp_interface) + verify_interface_exists(ipsec, dhcp_interface) dhcp_base = directories['isc_dhclient_dir'] if not os.path.exists(f'{dhcp_base}/dhclient_{dhcp_interface}.conf'): @@ -502,7 +502,7 @@ def verify(ipsec): if 'dhcp_interface' in peer_conf: dhcp_interface = peer_conf['dhcp_interface'] - verify_interface_exists(dhcp_interface) + verify_interface_exists(ipsec, dhcp_interface) dhcp_base = directories['isc_dhclient_dir'] if not os.path.exists(f'{dhcp_base}/dhclient_{dhcp_interface}.conf'): |