test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [V1] nics/net_device: modify the output of getting pci
@ 2022-05-09  9:57 Jun Dong
  2022-05-18  9:23 ` lijuan.tu
  0 siblings, 1 reply; 2+ messages in thread
From: Jun Dong @ 2022-05-09  9:57 UTC (permalink / raw)
  To: dts; +Cc: lijuan.tu, qingx.sun, junx.dong

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-18  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09  9:57 [dts] [V1] nics/net_device: modify the output of getting pci Jun Dong
2022-05-18  9:23 ` lijuan.tu

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