[dts] [PATCH V1] nics/system_info:adapt some environment memory echo unit is GB
Zhou Jun
junx.w.zhou at intel.com
Wed Mar 24 04:08:37 CET 2021
The previous environment memory information unit is MB.
At present, some new system memory information units are GB,
and DTS needs to be modified for adaptation.
Signed-off-by: Zhou Jun <junx.w.zhou at intel.com>
---
nics/system_info.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/nics/system_info.py b/nics/system_info.py
index da73b9f..70fdbf6 100644
--- a/nics/system_info.py
+++ b/nics/system_info.py
@@ -77,6 +77,7 @@ class SystemInfo(object):
Size: 8192 MB Locator: DIMM_A1 Speed: 2133 MHz
"""
s_regex = r"(\s+)Size: (\d+) MB"
+ s1_regex = r"(\s+)Size: (\d+) GB"
l_regex= r"(\s+)Locator: .*_(\w+)"
speed_regex = r"(\s+)Speed: (.*)"
size = ""
@@ -88,8 +89,11 @@ class SystemInfo(object):
total_size = 0
for line in lines:
m = re.match(s_regex, line)
+ m1 = re.match(s1_regex, line)
if m:
size = m.group(2)
+ if m1:
+ size = int(m1.group(2)) * 1024
l_m = re.match(l_regex, line)
if l_m:
locate = l_m.group(2)
--
1.8.3.1
More information about the dts
mailing list