summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-03 17:21:13 +0100
committerChristian Breunig <christian@breunig.cc>2024-01-03 17:22:59 +0100
commit301312b293238d3041c8912af6fdb86b506d7ab4 (patch)
tree659fd1f26a9ea0db2c84d8788a910c16bd0169e1 /python
parent82b4b2db8fda51df172210f470e5825b91e81de4 (diff)
downloadvyos-1x-301312b293238d3041c8912af6fdb86b506d7ab4.tar.gz
vyos-1x-301312b293238d3041c8912af6fdb86b506d7ab4.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.
Diffstat (limited to 'python')
-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):