From 714346e2ee0c61a08a9d17fdb962f2fbea9f73c9 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 20 Apr 2022 14:22:21 +0200 Subject: vyos.configdict: T4369: add is_node_changed() helper --- python/vyos/configdict.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 3f5b9a246..d6718a6e2 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 -- cgit v1.2.3