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é <f4bug@amsat.org>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20180116134217.8725-8-berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit f7a5376d4b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
stable-2.11
Daniel P. Berrange 2018-01-16 13:42:10 +00:00 committed by Michael Roth
parent 6622e94897
commit 8bbb76e050
1 changed files with 1 additions and 1 deletions

View File

@ -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):