From 3ee6549871626e4dad17b28894f0937a72b892fa Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Fri, 13 Aug 2021 08:57:37 -0500 Subject: xml: T3234: update instead of overwrite on repeated path (cherry picked from commit e5c61fc80119556bb1b61a80868d4a3470e07319) --- python/vyos/xml/load.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'python/vyos') 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 -- cgit v1.2.3