From 24a63e2bd19a5294ed9a8793663e8f62e5e0029a Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" 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é Signed-off-by: Daniel P. Berrange --- 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):