RedHatInsights / insights-core

Insights Core is a data collection and processing framework used by Red Hat Insights
https://cloud.redhat.com/insights
Apache License 2.0
149 stars 173 forks source link

[combiners.lspci] KeyError: '00:00.0 #3176

Closed psachin closed 3 years ago

psachin commented 3 years ago

Error:

  File "/home/psachin/source/insights/insights-core/insights/combiners/lspci.py", line 122, in __init__
    dev_k = lspci_k.data[dev['Slot']].copy()
KeyError: '00:00.0'

The key dev[Slot] from lspci_vmmkn is not the entire value found in lspci_k

>>> lspci_k.data
{'0000:00:00.0': {'Dev_Details': 'Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) (rev 03)'}, '0000:00:07.0': {'Dev_Details': 'ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)', 'Subsystem': 'Microsoft Corporation Device 0000'}, '0000:00:07.1': {'Dev_Details': 'IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)', 'Kernel driver in use': 'ata_piix', 'Kernel modules': 'ata_piix, pata_acpi, ata_generic'}, '0000:00:07.3': {'Dev_Details': 'Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02)', 'Kernel modules': 'i2c_piix4'}, '0000:00:08.0': {'Dev_Details': 'VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA', 'Kernel driver in use': 'hyperv_fb', 'Kernel modules': 'hyperv_fb'}, '1a06:00:02.0': {'Dev_Details': 'Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx Virtual Function] (rev 80)', 'Subsystem': 'Mellanox Technologies Device 0190', 'Kernel driver in use': 'mlx5_core', 'Kernel modules': 'mlx5_core'}}

>>> lspci_vmmkn
[{'Slot': '00:00.0', 'Class': '0600', 'Vendor': '8086', 'Device': '7192', 'Rev': '03'}, {'Slot': '00:07.0', 'Class': '0601', 'Vendor': '8086', 'Device': '7110', 'SVendor': '1414', 'SDevice': '0000', 'Rev': '01'}, {'Slot': '00:07.1', 'Class': '0101', 'Vendor': '8086', 'Device': '7111', 'Rev': '01', 'ProgIf': '80', 'Driver': 'ata_piix', 'Module': ['ata_piix', 'pata_acpi', 'ata_generic']}, {'Slot': '00:07.3', 'Class': '0680', 'Vendor': '8086', 'Device': '7113', 'Rev': '02', 'Module': ['i2c_piix4']}, {'Slot': '00:08.0', 'Class': '0300', 'Vendor': '1414', 'Device': '5353', 'Driver': 'hyperv_fb', 'Module': ['hyperv_fb']}, {'Slot': '1a06:00:02.0', 'Class': '0200', 'Vendor': '15b3', 'Device': '1016', 'SVendor': '15b3', 'SDevice': '0190', 'PhySlot': '1', 'Rev': '80', 'Driver': 'mlx5_core', 'Module': ['mlx5_core'], 'NUMANode': '0'}]
xiangce commented 3 years ago

Would you please provide a case/step which could reproduce this issue for the debugging/fixing convenience. Thanks.

xiangce commented 3 years ago

Here is sample data:

lspci -k

cat data/insights_commands/lspci_-k
0000:00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) (rev 03)
0000:00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)
        Subsystem: Microsoft Corporation Device 0000
0000:00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
        Kernel driver in use: ata_piix
        Kernel modules: ata_piix, pata_acpi, ata_generic
0000:00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02)
        Kernel modules: i2c_piix4
0000:00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA
        Kernel driver in use: hyperv_fb
        Kernel modules: hyperv_fb
1a06:00:02.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx Virtual Function] (rev 80)
        Subsystem: Mellanox Technologies Device 0190
        Kernel driver in use: mlx5_core
        Kernel modules: mlx5_core

lspci_-vmmkn

cat data/insights_commands/lspci_-vmmkn
Slot:   00:00.0
Class:  0600
Vendor: 8086
Device: 7192
Rev:    03

Slot:   00:07.0
Class:  0601
Vendor: 8086
Device: 7110
SVendor:        1414
SDevice:        0000
Rev:    01

Slot:   00:07.1
Class:  0101
Vendor: 8086
Device: 7111
Rev:    01
ProgIf: 80
Driver: ata_piix
Module: ata_piix
Module: pata_acpi
Module: ata_generic

Slot:   00:07.3
Class:  0680
Vendor: 8086
Device: 7113
Rev:    02
Module: i2c_piix4

Slot:   00:08.0
Class:  0300
Vendor: 1414
Device: 5353
Driver: hyperv_fb
Module: hyperv_fb

Slot:   1a06:00:02.0
Class:  0200
Vendor: 15b3
Device: 1016
SVendor:        15b3
SDevice:        0190
PhySlot:        1
Rev:    80
Driver: mlx5_core
Module: mlx5_core
NUMANode:       0