test suite reviews and discussions
 help / color / mirror / Atom feed
From: "xiao,qimai" <qimaix.xiao@intel.com>
To: dts@dpdk.org
Cc: "xiao,qimai" <qimaix.xiao@intel.com>
Subject: [dts] [PATCH V1 2/2] update this module to support single cpu env
Date: Thu,  4 Jul 2019 10:46:57 +0800	[thread overview]
Message-ID: <1562208417-144025-1-git-send-email-qimaix.xiao@intel.com> (raw)

fix regular expression of Locator to support both multi-core and
single-core cpu

Signed-off-by: xiao,qimai <qimaix.xiao@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


             reply	other threads:[~2019-07-04  2:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04  2:46 xiao,qimai [this message]
2019-07-04  2:43 ` Yao, BingX Y

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1562208417-144025-1-git-send-email-qimaix.xiao@intel.com \
    --to=qimaix.xiao@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).