[dts] [PATCH V1 2/2] update this module to support single cpu env
xiao,qimai
qimaix.xiao at intel.com
Thu Jul 4 04:46:57 CEST 2019
fix regular expression of Locator to support both multi-core and
single-core cpu
Signed-off-by: xiao,qimai <qimaix.xiao at intel.com>
---
nics/system_info.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/nics/system_info.py b/nics/system_info.py
index c813cd4..c4fea66 100644
--- a/nics/system_info.py
+++ b/nics/system_info.py
@@ -77,7 +77,7 @@ class SystemInfo(object):
Size: 8192 MB Locator: DIMM_A1 Speed: 2133 MHz
"""
s_regex = r"(\s+)Size: (\d+) MB"
- l_regex= r"(\s+)Locator: .*_(\w+)"
+ l_regex= r"(\s+)Locator: (CPU\d+_|)(\w+)"
speed_regex = r"(\s+)Speed: (.*)"
size = ""
locate = ""
@@ -92,7 +92,7 @@ class SystemInfo(object):
size = m.group(2)
l_m = re.match(l_regex, line)
if l_m:
- locate = l_m.group(2)
+ locate = l_m.group(3)
s_m = re.match(speed_regex, line)
if s_m:
speed = s_m.group(2)
--
2.17.1
More information about the dts
mailing list