summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-07-20 14:39:45 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-07-20 14:39:45 -0500
commita30395067a20375f050dc7f3d8f9c8644f0f4682 (patch)
tree572d7f9d488bde9cde2974319ef7b805b949357e /python
parentdb32a1e45776e1957c8c209ccc61c4079897661e (diff)
downloadvyos-1x-a30395067a20375f050dc7f3d8f9c8644f0f4682.tar.gz
vyos-1x-a30395067a20375f050dc7f3d8f9c8644f0f4682.zip
xml: T5345: replace dropped shift, necessary for compatability of args
The fix for T5345 dropped a necessary adjusment in the case of get_first_key=False.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/xml_ref/definition.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/python/vyos/xml_ref/definition.py b/python/vyos/xml_ref/definition.py
index 43101bb4e..d95d580e2 100644
--- a/python/vyos/xml_ref/definition.py
+++ b/python/vyos/xml_ref/definition.py
@@ -272,8 +272,13 @@ class Xml:
return self.get_defaults(path, get_first_key=get_first_key,
recursive=recursive)
if not self._well_defined(path, conf):
- print('path to config dict does not define full config paths')
- return {}
+ # adjust for possible overlap:
+ if path and path[-1] in list(conf):
+ conf = conf[path[-1]]
+ conf = {} if not isinstance(conf, dict) else conf
+ if not self._well_defined(path, conf):
+ print('path to config dict does not define full config paths')
+ return {}
res = self._relative_defaults(path, conf, recursive=recursive)