]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qapi: ensure stable sort ordering when checking QAPI entities
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 16 Jan 2018 13:42:10 +0000 (13:42 +0000)
committerEduardo Habkost <ehabkost@redhat.com>
Mon, 5 Feb 2018 21:53:54 +0000 (19:53 -0200)
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>
scripts/qapi.py

index 1fdd189c0da47d265432c6edc39f9dde9cce9208..58f995b07fd23299d1becf10b3165b0070c7fed7 100644 (file)
@@ -1678,7 +1678,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):