allow resolver to order inner values by returning OrderedDict
@@ -995,7 +995,10 @@ class InternalGetVariable(InternalThreadCommand):
if val_dict is None:
val_dict = {}
+ # assume properly ordered if resolver returns 'OrderedDict'
+ # check type as string to support OrderedDict backport for older Python
keys = dict_keys(val_dict)
+ if not val_dict.__class__.__name__ == "OrderedDict":
keys.sort(key=compare_object_attrs_key)
for k in keys:
