From 3395cefd5af205ab45b2db9269bbb4daa10ba7df Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 1 Jul 2020 18:39:41 -0500 Subject: config_dict: T2668: move keyword arg get_first_key into get_sub_dict --- python/vyos/config.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'python/vyos/config.py') diff --git a/python/vyos/config.py b/python/vyos/config.py index 4ebb68a09..6ad45819a 100644 --- a/python/vyos/config.py +++ b/python/vyos/config.py @@ -299,12 +299,7 @@ class Config(object): else: config_tree = vyos.configtree.ConfigTree(res) config_dict = json.loads(config_tree.to_json()) - config_dict = vyos.util.get_sub_dict(config_dict, self._make_path(path)) - if get_first_key and path and config_dict: - tmp = next(iter(config_dict.values())) - if not isinstance(tmp, dict): - raise TypeError("Data under node is not of type dict") - config_dict = tmp + config_dict = vyos.util.get_sub_dict(config_dict, self._make_path(path), get_first_key) if key_mangling: if not (isinstance(key_mangling, tuple) and \ -- cgit v1.2.3