[V1] nics/system_info: fix bug of re pattern expression
Commit Message
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@intel.com>
---
nics/system_info.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, 22 Apr 2022 17:38:34 +0800, Jun Dong <junx.dong@intel.com> wrote:
> 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@intel.com>
Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Applied, thanks
@@ -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 = ""