Skip to content

Commit 11c5b75

Browse files
committed
resource/udev: fix intermittent AttributeError in USBSDWireDevice
The control_serial attribute is conditionally declared by assignment which causes a race where it may not be declared before being accessed in USBSDWireExport _get_params(). This causes an AttributeError when starting the exporter. Remove the unused control_path attribute and explicitly declare control_serial to fix it. Signed-off-by: Matt Porter <[email protected]>
1 parent fc8901c commit 11c5b75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

labgrid/resource/udev.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ class USBSDWireDevice(USBResource):
483483
it is identified via USB using udev
484484
"""
485485

486-
control_path = attr.ib(
486+
control_serial = attr.ib(
487487
default=None,
488488
validator=attr.validators.optional(str)
489489
)
@@ -510,7 +510,7 @@ def avail(self, prop):
510510
pass
511511

512512
# Overwrite the poll function. Only mark the SDWire as available if both
513-
# paths are available.
513+
# control_serial and disk_path are available.
514514
def poll(self):
515515
super().poll()
516516
if self.device is not None and not self.avail:

0 commit comments

Comments
 (0)