From e052fd14a17e7872d0880720b15db2097b58f5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Tue, 21 Mar 2017 09:38:33 +0100 Subject: [PATCH] cpulist_present: explicitly sorted present CPUs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: rhbz#1432240 Signed-off-by: Jaroslav Škarvada --- tuned/profiles/functions/function_cpulist_present.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tuned/profiles/functions/function_cpulist_present.py b/tuned/profiles/functions/function_cpulist_present.py index 5b77230..ef3c1d6 100644 --- a/tuned/profiles/functions/function_cpulist_present.py +++ b/tuned/profiles/functions/function_cpulist_present.py @@ -5,7 +5,7 @@ from tuned.utils.commands import commands log = tuned.logs.get() -class cpulist_online(base.Function): +class cpulist_present(base.Function): """ Checks whether CPUs from list are present, returns list containing only present CPUs @@ -19,4 +19,4 @@ class cpulist_online(base.Function): return None cpus = self._cmd.cpulist_unpack(",,".join(args)) present = self._cmd.cpulist_unpack(self._cmd.read_file("/sys/devices/system/cpu/present")) - return ",".join(str(v) for v in set(cpus).intersection(set(present))) + return ",".join(str(v) for v in sorted(list(set(cpus).intersection(set(present)))))