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
diff --git a/checkbox_support/parsers/udevadm.py b/checkbox_support/parsers/udevadm.py
index b90b807..4f66733 100644
--- a/checkbox_support/parsers/udevadm.py
+++ b/checkbox_support/parsers/udevadm.py
@@ -185,6 +185,13 @@ class UdevadmDevice(object):
185 if bus == 'input' and any(d.bus == 'usb' for d in self._stack):185 if bus == 'input' and any(d.bus == 'usb' for d in self._stack):
186 bus = 'usb'186 bus = 'usb'
187187
188 # Only keep one device per udev path
189 if (
190 bus == 'bluetooth' and
191 [d for d in reversed(self._stack) if d.category == "BLUETOOTH"]
192 ):
193 return None
194
188 return bus195 return bus
189196
190 @bus.setter197 @bus.setter
@@ -865,6 +872,10 @@ class UdevadmParser(object):
865 device.bus == "virtio" and872 device.bus == "virtio" and
866 device.driver == "virtio_blk"):873 device.driver == "virtio_blk"):
867 return False874 return False
875 # Do not ignore Bluetooth devices w/o product & vendor ID.
876 # These can be virtual devices, yet still constitute valid devices.
877 if device.category == "BLUETOOTH":
878 return False
868879
869 # Ignore devices without product AND vendor information880 # Ignore devices without product AND vendor information
870 if (device.product is None and device.product_id is None and881 if (device.product is None and device.product_id is None and

Subscribers

People subscribed via source and target branches