From 4e85af1766e4368a4fa327abaccc12097251b3a5 Mon Sep 17 00:00:00 2001 From: Guannan Ma Date: Tue, 3 Jul 2018 13:54:14 +0800 Subject: [PATCH] fix CPU info identification --- cup/res/linux.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cup/res/linux.py b/cup/res/linux.py index cb043c8..0b28bed 100644 --- a/cup/res/linux.py +++ b/cup/res/linux.py @@ -83,8 +83,8 @@ def get_kernel_version(): """ versions = os.uname()[2] - version = versions[0: versions.find('_')] - return tuple([int(info) for info in version.split('.')]) + # version = versions[0: versions.find('_')] + return tuple([info for info in version.split('.')]) @cup.decorators.needlinux @@ -199,7 +199,7 @@ class MemInfo(collections.namedtuple('vmem', ' '.join([ _COLUMN_LOCK = threading.Lock() _COLUMN_LOCK.acquire() -if get_kernel_version() >= (2, 6, 33) and _CPU_COLUMNS.count('guest_nice') <= 0: +if get_kernel_version() >= ('2', '6', '33') and _CPU_COLUMNS.count('guest_nice') <= 0: _CPU_COLUMNS.append('guest_nice') _COLUMN_LOCK.release()