diff options
author | John Estabrook <jestabro@vyos.io> | 2023-06-15 12:14:29 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2023-06-15 12:14:29 -0500 |
commit | e1f2615453b24c81ade8813c8d89e1edcafb1bcf (patch) | |
tree | 61f383ccd5f5c184bb927e149264ffbb1ed939bd /python/vyos/configsession.py | |
parent | 127bc2cd3bd101556f40d3e5dbfdf8f683027191 (diff) | |
download | vyos-1x-e1f2615453b24c81ade8813c8d89e1edcafb1bcf.tar.gz vyos-1x-e1f2615453b24c81ade8813c8d89e1edcafb1bcf.zip |
configsession: T5248: load_section should not set path if dict empty
Diffstat (limited to 'python/vyos/configsession.py')
-rw-r--r-- | python/vyos/configsession.py | 5 |
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) |