From d22b29997cd5f6645355bb2fac84493ff6b25943 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Fri, 16 Oct 2009 15:56:21 +0200 Subject: [PATCH] serializer: Sort keys in JSON Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- lib/serializer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/serializer.py b/lib/serializer.py index 5df5bfd41..b54cd92f2 100644 --- a/lib/serializer.py +++ b/lib/serializer.py @@ -58,7 +58,7 @@ def DumpJson(data, indent=True): if not indent or _JSON_INDENT is None: txt = simplejson.dumps(data) else: - txt = simplejson.dumps(data, indent=_JSON_INDENT) + txt = simplejson.dumps(data, indent=_JSON_INDENT, sort_keys=True) txt = _RE_EOLSP.sub("", txt) if not txt.endswith('\n'): -- GitLab