Enfore key sorting for serializers

The sorting of keys is not enforced, which is causing some mismatches
for some strict testing. This patch enforce the sorting of keys when
doing JSON dumps.

Change-Id: I31ce5fa5e753cbf287429ad689752353530a4b4f
This commit is contained in:
tengqm 2015-04-29 10:46:07 -04:00
parent 9086166e93
commit 7ddbbd21e0
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ class JSONResponseSerializer(object):
return obj.isoformat()
return obj
response = json.dumps(data, default=sanitizer)
response = json.dumps(data, default=sanitizer, sort_keys=True)
LOG.debug("JSON response : %s" % response)
return response