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