summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-06-27 22:25:52 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-06-27 22:25:52 +0100
commit1f428866554b6ab8364e2501a249a590e4f0f65c (patch)
treee2edaa3cc59d804ded825cf0b94397b49f6f1eb2 /python/vyos
parent50068c7bbdb409a05684898481a7b4fbfcbb106f (diff)
downloadvyos-1x-1f428866554b6ab8364e2501a249a590e4f0f65c.tar.gz
vyos-1x-1f428866554b6ab8364e2501a249a590e4f0f65c.zip
xml: T2660: do replace - with _ for defaults when not flattening
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/xml/definition.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/python/vyos/xml/definition.py b/python/vyos/xml/definition.py
index e493c54c1..5421007e0 100644
--- a/python/vyos/xml/definition.py
+++ b/python/vyos/xml/definition.py
@@ -11,8 +11,6 @@
# You should have received a copy of the GNU Lesser General Public License along with this library;
# if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from copy import deepcopy
-
from vyos.xml import kw
# As we index by key, the name is first and then the data:
@@ -253,7 +251,14 @@ class XML(dict):
d = d[k]
if not flat:
- return deepcopy(d)
+ r = {}
+ for k in d:
+ under = k.replace('-','_')
+ if isinstance(d[k],dict):
+ r[under] = self.defaults(lpath + [k], flat)
+ continue
+ r[under] = d[k]
+ return r
def _flatten(inside, index, d):
r = {}