From e1f2615453b24c81ade8813c8d89e1edcafb1bcf Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 15 Jun 2023 12:14:29 -0500 Subject: configsession: T5248: load_section should not set path if dict empty --- python/vyos/configsession.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python/vyos/configsession.py') 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) -- cgit v1.2.3