summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Stepler <brandon@stepler.net>2021-01-06 23:44:00 -0500
committerBrandon Stepler <brandon@stepler.net>2021-01-06 23:44:00 -0500
commit903f4a3deee33c5836d67e3ada962887dc8bf945 (patch)
tree78fb5e9751a0c422bcec81bddcc1c44cbed58a3e
parent470d8f1fc555dc12251152b3dc620f611be604c0 (diff)
downloadvyos-1x-903f4a3deee33c5836d67e3ada962887dc8bf945.tar.gz
vyos-1x-903f4a3deee33c5836d67e3ada962887dc8bf945.zip
dhcpv6-pd: verify: T3193: allow more than one VLAN interface
VLAN interfaces contain periods, which make them incompatible with dict_search().
-rw-r--r--python/vyos/configverify.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index a425ca671..bbaf5e861 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -187,14 +187,14 @@ def verify_dhcpv6(config):
# assigned IPv6 subnet from a delegated prefix
for pd in dict_search('dhcpv6_options.pd', config):
sla_ids = []
+ interfaces = dict_search(f'dhcpv6_options.pd.{pd}.interface', config)
- if not dict_search(f'dhcpv6_options.pd.{pd}.interface', config):
+ if not interfaces:
raise ConfigError('DHCPv6-PD requires an interface where to assign '
'the delegated prefix!')
- for interface in dict_search(f'dhcpv6_options.pd.{pd}.interface', config):
- sla_id = dict_search(
- f'dhcpv6_options.pd.{pd}.interface.{interface}.sla_id', config)
+ for interface in interfaces:
+ sla_id = interfaces[interface].get('sla_id', None)
sla_ids.append(sla_id)
# Check for duplicates