Merge ~sylvain-pineau/checkbox-support:keep_bt_devices_without_product_id into checkbox-support:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 94ce79203846bf5016afd2667863a1526c651bb6
Merged at revision: cdf9d31cbe1f736400aeca9d15cf2d5a28cefb32
Proposed branch: ~sylvain-pineau/checkbox-support:keep_bt_devices_without_product_id
Merge into: checkbox-support:master
Diff against target: 29 lines (+11/-0)
1 file modified
checkbox_support/parsers/udevadm.py (+11/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+314673@code.launchpad.net

Description of the change

Fix BT device detection. Previous logic was filtering devices w/o a product/vendor id.
We've found systems with virtual bt devices (which are still valid devices).

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/checkbox_support/parsers/udevadm.py b/checkbox_support/parsers/udevadm.py
2index b90b807..4f66733 100644
3--- a/checkbox_support/parsers/udevadm.py
4+++ b/checkbox_support/parsers/udevadm.py
5@@ -185,6 +185,13 @@ class UdevadmDevice(object):
6 if bus == 'input' and any(d.bus == 'usb' for d in self._stack):
7 bus = 'usb'
8
9+ # Only keep one device per udev path
10+ if (
11+ bus == 'bluetooth' and
12+ [d for d in reversed(self._stack) if d.category == "BLUETOOTH"]
13+ ):
14+ return None
15+
16 return bus
17
18 @bus.setter
19@@ -865,6 +872,10 @@ class UdevadmParser(object):
20 device.bus == "virtio" and
21 device.driver == "virtio_blk"):
22 return False
23+ # Do not ignore Bluetooth devices w/o product & vendor ID.
24+ # These can be virtual devices, yet still constitute valid devices.
25+ if device.category == "BLUETOOTH":
26+ return False
27
28 # Ignore devices without product AND vendor information
29 if (device.product is None and device.product_id is None and

Subscribers

People subscribed via source and target branches