diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/config.py | 4 | ||||
-rw-r--r-- | python/vyos/xml_ref/definition.py | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/python/vyos/config.py b/python/vyos/config.py index b0dbc5c2a..179f60c43 100644 --- a/python/vyos/config.py +++ b/python/vyos/config.py @@ -245,9 +245,9 @@ class Config(object): """ lpath = self._make_path(path) root_dict = self.get_cached_root_dict(effective) - conf_dict = get_sub_dict(root_dict, lpath, get_first_key) + conf_dict = get_sub_dict(root_dict, lpath, get_first_key=get_first_key) - if key_mangling is None and no_multi_convert and not with_defaults: + if key_mangling is None and no_multi_convert and not (with_defaults or with_recursive_defaults): return deepcopy(conf_dict) rpath = lpath if get_first_key else lpath[:-1] 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) |