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

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).