SHA256
1
0
forked from pool/qemu
qemu/0039-qapi-ensure-stable-sort-ordering-wh.patch
Bruce Rogers bd7e079f56 Accepting request 569754 from home:bfrogers:branches:Virtualization
Hopefully we're at least close to the right stuff for handling python2 vs python3 right with these changes.

OBS-URL: https://build.opensuse.org/request/show/569754
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=384
2018-01-25 23:50:30 +00:00

33 lines
1.1 KiB
Diff

From 24a63e2bd19a5294ed9a8793663e8f62e5e0029a Mon Sep 17 00:00:00 2001
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Mon, 15 Jan 2018 17:40:33 -0700
Subject: [PATCH] qapi: ensure stable sort ordering when checking QAPI entities
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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>
---
scripts/qapi.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 88e854edec..94d52f7eb5 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -1687,7 +1687,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):