summaryrefslogtreecommitdiff
path: root/python/vyos/configdict.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-16 15:10:13 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-16 15:29:28 +0100
commit452a9c504f472dcaee8c93947a889dab4f8259ce (patch)
treecc8ca551378550087c052da5de2bbbe850cb797f /python/vyos/configdict.py
parent0ee4ed4ab400474e29a9f0e4e608a68050255f38 (diff)
downloadvyos-1x-452a9c504f472dcaee8c93947a889dab4f8259ce.tar.gz
vyos-1x-452a9c504f472dcaee8c93947a889dab4f8259ce.zip
vyos.configdict: node_changed() now accepts key mangling parameter
Diffstat (limited to 'python/vyos/configdict.py')
-rw-r--r--python/vyos/configdict.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index e5e758a8b..4f9d3739d 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()