Skip to content

Commit d144c88

Browse files
committed
Including the use of ':' in a device label.
Signed-off-by: Rob Dobson <[email protected]>
1 parent bab0a3a commit d144c88

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

hwinfo/pci/lspci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class ParserException(Exception):
66
pass
77

8-
LABEL_REGEX = r'[\w+\ \.\,\+\&\-\/\[\]\(\)]+'
8+
LABEL_REGEX = r'[\w+\ \.\,\:\+\&\-\/\[\]\(\)]+'
99
CODE_REGEX = r'[0-9a-fA-F]{4}'
1010
BUSID_REGEX = r'[0-9a-fA-F]{2}:[0-9a-fA-F]{2}\.[0-9a-fA-F]'
1111

hwinfo/pci/tests/test_lspci.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,24 @@ class EmulexNicDeviceParse(TestSingleDeviceNNMMParse):
225225
'pci_subdevice_id': 'e70b',
226226
}
227227

228+
class EmulexHbDeviceParse(TestSingleDeviceNNMMParse):
229+
230+
SAMPLE_DATA = '07:00.0 "Fibre Channel [0c04]" "Emulex Corporation [10df]" "Saturn-X: LightPulse Fibre Channel Host Adapter [f100]" -r03 "Hewlett-Packard Company [103c]" "Device [3282]"'
231+
232+
DEVICE_REC = {
233+
'pci_device_bus_id': '07:00.0',
234+
'pci_device_class': '0c04',
235+
'pci_device_class_name': 'Fibre Channel',
236+
'pci_vendor_name': 'Emulex Corporation',
237+
'pci_vendor_id': '10df',
238+
'pci_device_id': 'f100',
239+
'pci_device_name': 'Saturn-X: LightPulse Fibre Channel Host Adapter',
240+
'pci_subvendor_name': 'Hewlett-Packard Company',
241+
'pci_subvendor_id': '103c',
242+
'pci_subdevice_name': 'Device',
243+
'pci_subdevice_id': '3282',
244+
}
245+
228246
class LsiSASDeviceParse(TestSingleDeviceNNMMParse):
229247

230248
SAMPLE_DATA = '06:00.0 "Serial Attached SCSI controller [0107]" "LSI Logic / Symbios Logic [1000]" "SAS2004 PCI-Express Fusion-MPT SAS-2 [Spitfire] [0070]" -r03 "IBM [1014]" "Device [03f8]"'

0 commit comments

Comments
 (0)