summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-12-24 10:17:20 +0100
committerChristian Breunig <christian@breunig.cc>2023-12-24 13:13:27 +0100
commit5e7a8288d06a6d6beee5e1abd2e06698ab778650 (patch)
treed748b757485782baab33f06131f88c43e01d2222 /python
parent89cd75b8dbe5cc145a4423bf10faa76fd6bdcdbf (diff)
downloadvyos-1x-5e7a8288d06a6d6beee5e1abd2e06698ab778650.tar.gz
vyos-1x-5e7a8288d06a6d6beee5e1abd2e06698ab778650.zip
T5837: cleanup use of calls to vyos.configdict.node_changed()
node_changed() will return a list of changed keys under "path". We are not always interested what changed, sometimes we are only interested if something changed at all, that what vyos.configdict.is_node_changed() is for.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configdict.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index 075ffe466..ed8137c0a 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -104,6 +104,10 @@ def list_diff(first, second):
return [item for item in first if item not in second]
def is_node_changed(conf, path):
+ """
+ Check if any key under path has been changed and return True.
+ If nothing changed, return false
+ """
from vyos.configdiff import get_config_diff
D = get_config_diff(conf, key_mangling=('-', '_'))
return D.is_node_changed(path)