diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-20 14:22:21 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-29 20:28:36 +0200 |
commit | 598e88f6d0e6ba743b128b0b8b6eb65f804a7e4c (patch) | |
tree | c324202ce1f9b27d073def587d18b8f1f274a80c /python | |
parent | 2a2bb78fb1dc01a1adc454b637f92cd99f698db7 (diff) | |
download | vyos-1x-598e88f6d0e6ba743b128b0b8b6eb65f804a7e4c.tar.gz vyos-1x-598e88f6d0e6ba743b128b0b8b6eb65f804a7e4c.zip |
vyos.configdict: T4369: add is_node_changed() helper
(cherry picked from commit 714346e2ee0c61a08a9d17fdb962f2fbea9f73c9)
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configdict.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 1f245f3d2..be10cbdfc 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -104,6 +104,12 @@ def list_diff(first, second): second = set(second) return [item for item in first if item not in second] +def is_node_changed(conf, path): + from vyos.configdiff import get_config_diff + D = get_config_diff(conf, key_mangling=('-', '_')) + D.set_level(conf.get_level()) + return D.is_node_changed(path) + def leaf_node_changed(conf, path): """ Check if a leaf node was altered. If it has been altered - values has been |