From 28d4d1f5e7d906c721659c166a9530f3d9db5bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 27 Feb 2018 16:30:20 +0000 Subject: [PATCH] Non-deterministic python hash iterator sort ordering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel P. Berrangé --- ...le-sort-ordering-when-checking-QAPI-.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 0001-qapi-ensure-stable-sort-ordering-when-checking-QAPI-.patch diff --git a/0001-qapi-ensure-stable-sort-ordering-when-checking-QAPI-.patch b/0001-qapi-ensure-stable-sort-ordering-when-checking-QAPI-.patch new file mode 100644 index 0000000..2fb9de0 --- /dev/null +++ b/0001-qapi-ensure-stable-sort-ordering-when-checking-QAPI-.patch @@ -0,0 +1,37 @@ +From f7a5376d4b667cf6c83c1d640e32d22456d7b5ee Mon Sep 17 00:00:00 2001 +From: "Daniel P. Berrange" +Date: Tue, 16 Jan 2018 13:42:10 +0000 +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é +Signed-off-by: Daniel P. Berrange +Message-Id: <20180116134217.8725-8-berrange@redhat.com> +Signed-off-by: Eduardo Habkost +--- + scripts/qapi.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/qapi.py b/scripts/qapi.py +index 1fdd189c0d..58f995b07f 100644 +--- a/scripts/qapi.py ++++ b/scripts/qapi.py +@@ -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): +-- +2.14.3 +