[PATCH V1] nics/system_info: fix bug of re pattern expression
Jun Dong
junx.dong at intel.com
Fri Apr 22 11:38:34 CEST 2022
There are some different forms of location information of memory in
different platform, such as: "Locator: DIMM_A1", "Locator: DIMM 0",
"P1-DIMMA1","Locator: CPU1_DIMM_A2". The original re pattern expression
cann't match in some platform, this patch fixed it.
Signed-off-by: Jun Dong <junx.dong at intel.com>
---
nics/system_info.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nics/system_info.py b/nics/system_info.py
index 5ecdd77d..fa8525de 100644
--- a/nics/system_info.py
+++ b/nics/system_info.py
@@ -80,7 +80,7 @@ class SystemInfo(object):
"""
s_regex = r"(\s+)Size: (\d+) MB"
s1_regex = r"(\s+)Size: (\d+) GB"
- l_regex = r"(\s+)Locator: .*_(\w+)"
+ l_regex = r"(\s+)Locator: .*[_\-\s](\w+)"
speed_regex = r"(\s+)Speed: (.*)"
size = ""
locate = ""
--
2.33.1.windows.1
More information about the dts
mailing list