summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-06-15 12:14:29 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-06-15 12:14:29 -0500
commite1f2615453b24c81ade8813c8d89e1edcafb1bcf (patch)
tree61f383ccd5f5c184bb927e149264ffbb1ed939bd
parent127bc2cd3bd101556f40d3e5dbfdf8f683027191 (diff)
downloadvyos-1x-e1f2615453b24c81ade8813c8d89e1edcafb1bcf.tar.gz
vyos-1x-e1f2615453b24c81ade8813c8d89e1edcafb1bcf.zip
configsession: T5248: load_section should not set path if dict empty
-rw-r--r--python/vyos/configsession.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py
index 88eedb944..decb82437 100644
--- a/python/vyos/configsession.py
+++ b/python/vyos/configsession.py
@@ -166,8 +166,9 @@ class ConfigSession(object):
def load_section(self, path: list, d: dict):
try:
self.delete(path)
- for p in dict_to_paths(d):
- self.set(path + p)
+ if d:
+ for p in dict_to_paths(d):
+ self.set(path + p)
except (ValueError, ConfigSessionError) as e:
raise ConfigSessionError(e)