summaryrefslogtreecommitdiff
path: root/python/vyos/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos/config.py')
-rw-r--r--python/vyos/config.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/vyos/config.py b/python/vyos/config.py
index 0bc6be12a..e992163a2 100644
--- a/python/vyos/config.py
+++ b/python/vyos/config.py
@@ -278,8 +278,12 @@ class Config(object):
Returns: a dict representation of the config
"""
res = self.show_config(self._make_path(path), effective=effective)
- config_tree = vyos.configtree.ConfigTree(res)
- config_dict = json.loads(config_tree.to_json())
+ if res:
+ config_tree = vyos.configtree.ConfigTree(res)
+ config_dict = json.loads(config_tree.to_json())
+ else:
+ config_dict = {}
+
return config_dict
def is_multi(self, path):