1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

M #-: pyone: Use OrderedDict when storing _root (#2027) (#2450)

This commit is contained in:
Jan Orel 2023-01-17 18:51:03 +01:00 committed by GitHub
parent 3aaf41195b
commit 9e122bae47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,6 +110,9 @@ def child2dict(element):
# Replace 'None' values returned by xmltodict by ""
none2emptystr(ret)
if not isinstance(ret[tagName], OrderedDict) and isinstance(ret[tagName], dict):
ret[tagName] = OrderedDict(ret[tagName])
# return the contents dictionary, but save a reference
ret[tagName]._root = ret
return ret[tagName]