mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
split slot info
This commit is contained in:
@ -104,6 +104,20 @@ def parse(
|
|||||||
device_output = {}
|
device_output = {}
|
||||||
|
|
||||||
device_output['slot'] = line.split()[1]
|
device_output['slot'] = line.split()[1]
|
||||||
|
|
||||||
|
slot_info = line.split()[1]
|
||||||
|
*domain, bus, dev_fun = slot_info.split(':')
|
||||||
|
|
||||||
|
if domain:
|
||||||
|
dom = domain[0]
|
||||||
|
else:
|
||||||
|
dom = None
|
||||||
|
|
||||||
|
dev, fun = dev_fun.split('.')
|
||||||
|
device_output['domain'] = dom
|
||||||
|
device_output['bus'] = bus
|
||||||
|
device_output['dev'] = dev
|
||||||
|
device_output['function'] = fun
|
||||||
continue
|
continue
|
||||||
|
|
||||||
key, val = line.split(maxsplit=1)
|
key, val = line.split(maxsplit=1)
|
||||||
|
9
tests/fixtures/ubuntu-20.10/lspci-nnmmv.out
vendored
9
tests/fixtures/ubuntu-20.10/lspci-nnmmv.out
vendored
@ -303,3 +303,12 @@ SDevice: SATA AHCI controller [07e0]
|
|||||||
PhySlot: 37
|
PhySlot: 37
|
||||||
ProgIf: 01
|
ProgIf: 01
|
||||||
|
|
||||||
|
Slot: ff:02:05.0
|
||||||
|
Class: SATA controller [0106]
|
||||||
|
Vendor: VMware [15ad]
|
||||||
|
Device: SATA AHCI controller [07e0]
|
||||||
|
SVendor: VMware [15ad]
|
||||||
|
SDevice: SATA AHCI controller [07e0]
|
||||||
|
PhySlot: 37
|
||||||
|
ProgIf: 01
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user