From a30395067a20375f050dc7f3d8f9c8644f0f4682 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 20 Jul 2023 14:39:45 -0500 Subject: 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. --- python/vyos/xml_ref/definition.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'python') 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) -- cgit v1.2.3