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

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

This commit is contained in:
Jan Orel 2022-05-09 19:18:20 +02:00 committed by GitHub
parent c7382a5119
commit bf6ef68bd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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]