Skip to content

Commit f63dfd7

Browse files
authored
Merge pull request #1754 from ohporter/sdwire-fix
resource/udev: fix intermittent AttributeError in USBSDWireDevice
2 parents bf38749 + 064947f commit f63dfd7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

labgrid/resource/udev.py

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

486-
control_path = attr.ib(
487-
default=None,
488-
validator=attr.validators.optional(str)
489-
)
490486
disk_path = attr.ib(
491487
default=None,
492488
validator=attr.validators.optional(str)
493489
)
494490

495491
def __attrs_post_init__(self):
492+
self.control_serial = None
496493
self.match['ID_VENDOR_ID'] = '04e8'
497494
self.match['ID_MODEL_ID'] = '6001'
498495
self.match['@ID_VENDOR_ID'] = '0424'
@@ -510,7 +507,7 @@ def avail(self, prop):
510507
pass
511508

512509
# Overwrite the poll function. Only mark the SDWire as available if both
513-
# paths are available.
510+
# control_serial and disk_path are available.
514511
def poll(self):
515512
super().poll()
516513
if self.device is not None and not self.avail:

0 commit comments

Comments
 (0)