test suite reviews and discussions
 help / color / mirror / Atom feed
From: Jun Dong <junx.dong@intel.com>
To: dts@dpdk.org
Cc: lijuan.tu@intel.com, qingx.sun@intel.com, junx.dong@intel.com
Subject: [dts] [V1] nics/net_device: modify the output of getting pci
Date: Mon,  9 May 2022 17:57:10 +0800
Message-ID: <20220509095710.846-1-junx.dong@intel.com> (raw)

About querying device pci information, the results are different on 
different versions of pexpect, some versions has space char in output 
front end, so strip the space char to improve stability.

Signed-off-by: Jun Dong <junx.dong@intel.com>
---
 nics/net_device.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nics/net_device.py b/nics/net_device.py
index 4ef755e0..f616c6d2 100644
--- a/nics/net_device.py
+++ b/nics/net_device.py
@@ -941,14 +941,14 @@ def get_pci_id(crb, domain_id, bus_id, devfun_id):
         bus_id,
         devfun_id,
     )
-    out = crb.send_expect(command, "# ")
+    out = crb.send_expect(command, "# ").strip()
     vendor = out[2:]
     command = "cat /sys/bus/pci/devices/%s\:%s\:%s/device" % (
         domain_id,
         bus_id,
         devfun_id,
     )
-    out = crb.send_expect(command, "# ")
+    out = crb.send_expect(command, "# ").strip()
     device = out[2:]
     return "%s:%s" % (vendor, device)
 
-- 
2.33.1.windows.1


             reply	other threads:[~2022-05-09  9:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09  9:57 Jun Dong [this message]
2022-05-18  9:23 ` lijuan.tu

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=20220509095710.846-1-junx.dong@intel.com \
    --to=junx.dong@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    --cc=qingx.sun@intel.com \
    /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

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git