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
This commit is contained in:
Tony Breeds 2017-08-31 14:39:37 +10:00
parent 8da389729b
commit f2bad7d90d
1 changed files with 1 additions and 1 deletions

View File

@ -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])