[V1] nics/net_device: modify the output of getting pci
Checks
Context |
Check |
Description |
ci/Intel-dts-suite-test |
success
|
Testing OK
|
ci/Intel-dts-format-test |
success
|
Testing OK
|
ci/Intel-dts-pylama-test |
success
|
Testing OK
|
Commit Message
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(-)
Comments
On Mon, 9 May 2022 17:57:10 +0800, Jun Dong <junx.dong@intel.com> wrote:
> 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>
Applied, thanks
@@ -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)