summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-03 17:21:13 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-01-04 06:58:41 +0000
commit4b06cac36c8ca4d63926871885e8ac52a5a899f1 (patch)
tree4b0d30a1326abd4b7c32c65959ccb8892b90f881 /python/vyos
parentdc12636770037b7ac043075e722dd3110a7364d3 (diff)
downloadvyos-1x-4b06cac36c8ca4d63926871885e8ac52a5a899f1.tar.gz
vyos-1x-4b06cac36c8ca4d63926871885e8ac52a5a899f1.zip
configdict: T5837: node_changed() shall not return duplicate list items
This extends commit 4ee406470 ("configdict: T5837: add support to return added nodes when calling node_changed()") so no duplicate list elements get returned. (cherry picked from commit 301312b293238d3041c8912af6fdb86b506d7ab4)
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/configdict.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index 6a421485f..089d9d3d5 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -163,6 +163,9 @@ def node_changed(conf, path, key_mangling=None, recursive=False, expand_nodes=No
output.extend(list(tmp['delete'].keys()))
if expand_nodes & Diff.ADD:
output.extend(list(tmp['add'].keys()))
+
+ # remove duplicate keys from list, this happens when a node (e.g. description) is altered
+ output = list(dict.fromkeys(output))
return output
def get_removed_vlans(conf, path, dict):