Merge ~sylvain-pineau/plainbox-provider-resource:fix_graphics_card_resource_missing_vendor_id into plainbox-provider-resource:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 98ddcb1b59c78903b64b8412c9c6265f52c889fd
Merged at revision: f365223d513225539cd785dbce192a0752501d5b
Proposed branch: ~sylvain-pineau/plainbox-provider-resource:fix_graphics_card_resource_missing_vendor_id
Merge into: plainbox-provider-resource:master
Diff against target: 13 lines (+1/-1)
1 file modified
bin/graphics_card_resource.py (+1/-1)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+391598@code.launchpad.net

Commit message

bin:graphics_card_resource: Properly handle devices w/o vendor_id

Description of the change

bin:graphics_card_resource: Properly handle devices w/o vendor_id

Video devices found using /dev/dri/card* only have a product field.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

self-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/graphics_card_resource.py b/bin/graphics_card_resource.py
2index edd3b3b..6a48ccd 100755
3--- a/bin/graphics_card_resource.py
4+++ b/bin/graphics_card_resource.py
5@@ -140,7 +140,7 @@ def main():
6 for index, record in enumerate(video_devices, 1):
7 record['index'] = index
8 record['gpu_count'] = len(video_devices)
9- if record['vendor_id'] == '4098': # vendor == amd/ati
10+ if record.get('vendor_id', '') == '4098': # vendor == amd/ati
11 if subprocess.call(
12 ['dpkg-query', '-W', 'vulkan-amdgpu-pro'],
13 stderr=subprocess.STDOUT,

Subscribers

People subscribed via source and target branches