From a652a35c2092b7e2bcabb5ec84bebae9a0bf7a26 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Thu, 31 Aug 2017 14:39:37 +1000 Subject: [PATCH] Ensure that GetHostCpusListAction.run() returns a deterministic result As the return value of keys() isn't guaranteed to be the same between different runs sort them so the items we add are in a predictable order Change-Id: Ie3106b5a167f59754241e7aaf8ad1944405d5023 Closes-Bug: 1714158 (cherry picked from commit f2bad7d90da0f0a5612d2e1bc2b9fa46c2d5e859) --- tripleo_common/actions/derive_params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tripleo_common/actions/derive_params.py b/tripleo_common/actions/derive_params.py index 47e69a15d..562ef7b88 100644 --- a/tripleo_common/actions/derive_params.py +++ b/tripleo_common/actions/derive_params.py @@ -253,7 +253,7 @@ class GetHostCpusListAction(base.TripleOAction): numa_nodes_threads[cpu['numa_node']].extend( cpu['thread_siblings']) - for numa_node in numa_nodes_threads.keys(): + for numa_node in sorted(numa_nodes_threads.keys()): node = int(numa_node) # Gets least thread in NUMA node numa_node_min = min(numa_nodes_threads[numa_node])