summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2021-08-13 08:57:37 -0500
committerJohn Estabrook <jestabro@vyos.io>2021-08-13 12:18:22 -0500
commit3ee6549871626e4dad17b28894f0937a72b892fa (patch)
tree6fe62b40ed3cca82a06c1e2b338c6d27f47e0225 /python/vyos
parent377df2b8abeaae051bcec5be5126494d3b003b2d (diff)
downloadvyos-1x-3ee6549871626e4dad17b28894f0937a72b892fa.tar.gz
vyos-1x-3ee6549871626e4dad17b28894f0937a72b892fa.zip
xml: T3234: update instead of overwrite on repeated path
(cherry picked from commit e5c61fc80119556bb1b61a80868d4a3470e07319)
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/xml/load.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/python/vyos/xml/load.py b/python/vyos/xml/load.py
index 37479c6e1..0578bef80 100644
--- a/python/vyos/xml/load.py
+++ b/python/vyos/xml/load.py
@@ -125,14 +125,20 @@ def _format_nodes(inside, conf, xml):
for node in nodes:
name = node.pop('@name')
into = inside + [name]
- r[name] = _format_node(into, node, xml)
+ if name in r:
+ r[name].update(_format_node(into, node, xml))
+ else:
+ r[name] = _format_node(into, node, xml)
r[name][kw.node] = nodename
xml[kw.tags].append(' '.join(into))
else:
node = nodes
name = node.pop('@name')
into = inside + [name]
- r[name] = _format_node(inside + [name], node, xml)
+ if name in r:
+ r[name].update(_format_node(inside + [name], node, xml))
+ else:
+ r[name] = _format_node(inside + [name], node, xml)
r[name][kw.node] = nodename
xml[kw.tags].append(' '.join(into))
return r