Skip to content

Commit

Permalink
[Fix issue #558] Add a condition check before subvendor dict creation
Browse files Browse the repository at this point in the history
- Updated jc/parsers/pci_ids.py adding a check to see if the subvendor dict is already created

Signed-off-by: Sam SIU <[email protected]>
  • Loading branch information
ssiuhk committed Apr 10, 2024
1 parent abda873 commit 61e3dc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jc/parsers/pci_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def parse(
if vdc_subvendor:
subvendor = '_' + vdc_subvendor.groupdict()['subvendor']
subdevice = '_' + vdc_subvendor.groupdict()['subdevice']
vdc_obj[vendor_id][device_id][subvendor] = {}
if not vdc_obj[vendor_id][device_id].get(subvendor) or not isinstance(vdc_obj[vendor_id][device_id][subvendor], dict):
vdc_obj[vendor_id][device_id][subvendor] = {}
vdc_obj[vendor_id][device_id][subvendor][subdevice] = {}
vdc_obj[vendor_id][device_id][subvendor][subdevice]['subsystem_name'] = vdc_subvendor.groupdict()['subsystem_name']
continue
Expand Down

0 comments on commit 61e3dc9

Please sign in to comment.