diff options
Diffstat (limited to 'python/vyos/configdict.py')
-rw-r--r-- | python/vyos/configdict.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index e5e758a8b..5acb1fdfe 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -126,14 +126,14 @@ def leaf_node_changed(conf, path): return None -def node_changed(conf, path): +def node_changed(conf, path, key_mangling=None): """ Check if a leaf node was altered. If it has been altered - values has been changed, or it was added/removed, we will return the old value. If nothing has been changed, None is returned """ from vyos.configdiff import get_config_diff, Diff - D = get_config_diff(conf, key_mangling=('-', '_')) + D = get_config_diff(conf, key_mangling) D.set_level(conf.get_level()) # get_child_nodes() will return dict_keys(), mangle this into a list with PEP448 keys = D.get_child_nodes_diff(path, expand_nodes=Diff.DELETE)['delete'].keys() @@ -272,9 +272,9 @@ def has_vlan_subinterface_configured(conf, intf): old_level = conf.get_level() conf.set_level([]) - intfpath = 'interfaces ' + Section.get_config_path(intf) - if ( conf.exists(f'{intfpath} vif') or - conf.exists(f'{intfpath} vif-s')): + intfpath = ['interfaces', Section.section(intf), intf] + if ( conf.exists(intfpath + ['vif']) or + conf.exists(intfpath + ['vif-s'])): ret = True conf.set_level(old_level) |