From: Daniel P. Berrange Date: Tue, 16 Jan 2018 13:42:10 +0000 (+0000) Subject: qapi: ensure stable sort ordering when checking QAPI entities X-Git-Tag: v2.11.2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bbb76e05023bfa64e197475a072e599d046b3ba;p=thirdparty%2Fqemu.git qapi: ensure stable sort ordering when checking QAPI entities Some early python 3.x versions will have different default ordering when calling the 'values()' method on a dict, compared to python 2.x and later 3.x versions. Explicitly sort the items to get a stable ordering. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P. Berrange Message-Id: <20180116134217.8725-8-berrange@redhat.com> Signed-off-by: Eduardo Habkost (cherry picked from commit f7a5376d4b667cf6c83c1d640e32d22456d7b5ee) Signed-off-by: Michael Roth --- diff --git a/scripts/qapi.py b/scripts/qapi.py index 62dc52ed6e0..99a4cbd5569 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -1679,7 +1679,7 @@ class QAPISchema(object): assert False def check(self): - for ent in self._entity_dict.values(): + for (name, ent) in sorted(self._entity_dict.items()): ent.check(self) def visit(self, visitor):