diff options
author | John Estabrook <jestabro@vyos.io> | 2021-08-13 08:57:37 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2021-08-13 12:18:22 -0500 |
commit | 3ee6549871626e4dad17b28894f0937a72b892fa (patch) | |
tree | 6fe62b40ed3cca82a06c1e2b338c6d27f47e0225 | |
parent | 377df2b8abeaae051bcec5be5126494d3b003b2d (diff) | |
download | vyos-1x-3ee6549871626e4dad17b28894f0937a72b892fa.tar.gz vyos-1x-3ee6549871626e4dad17b28894f0937a72b892fa.zip |
xml: T3234: update instead of overwrite on repeated path
(cherry picked from commit e5c61fc80119556bb1b61a80868d4a3470e07319)
-rw-r--r-- | python/vyos/xml/load.py | 10 |
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 |