summaryrefslogtreecommitdiff
path: root/python/vyos/configverify.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-08-23 14:22:41 +0200
committerChristian Poessinger <christian@poessinger.com>2020-08-23 14:22:41 +0200
commitaa25690c83c4812c92490d29b564dd0330b24d34 (patch)
tree15c5f45b5f82fd5b788c842caeba06d3d81d96f9 /python/vyos/configverify.py
parent20ef1aab793504cf4956dedeeadaf528933b7ccf (diff)
downloadvyos-1x-aa25690c83c4812c92490d29b564dd0330b24d34.tar.gz
vyos-1x-aa25690c83c4812c92490d29b564dd0330b24d34.zip
T2755: convert jmespath.search() to vyos_dict_search() for performance
Diffstat (limited to 'python/vyos/configverify.py')
-rw-r--r--python/vyos/configverify.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 264dd1c30..7e1930878 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -93,17 +93,18 @@ def verify_dhcpv6(config):
"""
if 'dhcpv6_options' in config:
from vyos.util import vyos_dict_search
+
if {'parameters_only', 'temporary'} <= set(config['dhcpv6_options']):
raise ConfigError('DHCPv6 temporary and parameters-only options '
'are mutually exclusive!')
# It is not allowed to have duplicate SLA-IDs as those identify an
# assigned IPv6 subnet from a delegated prefix
- for pd in vyos_dict_search(config, 'dhcpv6_options.pd'):
+ for pd in vyos_dict_search('dhcpv6_options.pd', config):
sla_ids = []
- for interface in vyos_dict_search(config, f'dhcpv6_options.pd.{pd}.interface'):
- sla_id = vyos_dict_search(config,
- f'dhcpv6_options.pd.{pd}.interface.{interface}.sla_id')
+ for interface in vyos_dict_search(f'dhcpv6_options.pd.{pd}.interface', config):
+ sla_id = vyos_dict_search(
+ f'dhcpv6_options.pd.{pd}.interface.{interface}.sla_id', config)
sla_ids.append(sla_id)
# Check for duplicates