1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

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

(cherry picked from commit bf6ef68bd15a825e5ccb1ce3602f868257d6a22a)
This commit is contained in:
Jan Orel 2022-05-09 19:18:20 +02:00 committed by Ruben S. Montero
parent c3d6e65612
commit e5e16ef9b5
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -124,6 +124,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]