From dc2cda7d255e962e9c8f6db844506264eb40b786 Mon Sep 17 00:00:00 2001 From: Piotr Bartman Date: Wed, 8 May 2024 15:02:10 +0200 Subject: [PATCH] q-dev: update device protocol v2 --- qubesadmin/device_protocol.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/qubesadmin/device_protocol.py b/qubesadmin/device_protocol.py index 79fa5e28..e1402cf0 100644 --- a/qubesadmin/device_protocol.py +++ b/qubesadmin/device_protocol.py @@ -582,10 +582,10 @@ def interfaces(self) -> List[DeviceInterface]: @property def parent_device(self) -> Optional[Device]: """ - The parent device if any. + The parent device, if any. - If the device is part of another device (e.g. it's a single - partition of an usb stick), the parent device id should be here. + If the device is part of another device (e.g., it's a single + partition of a USB stick), the parent device id should be here. """ return self._parent @@ -594,7 +594,7 @@ def subdevices(self) -> List['DeviceInfo']: """ The list of children devices if any. - If the device has subdevices (e.g. partitions of an usb stick), + If the device has subdevices (e.g., partitions of a USB stick), the subdevices id should be here. """ return [dev for dev in self.backend_domain.devices[self.devclass] @@ -626,7 +626,7 @@ def serialize(self) -> bytes: if self.attachment: properties = self.pack_property( - properties, 'attachment', self.attachment.name) + 'attachment', self.attachment.name) properties += b' ' + self.pack_property( 'interfaces', @@ -764,6 +764,7 @@ def sanitize_str( if replace_char is None: not_allowed_chars = set(untrusted_value) - allowed_chars if not_allowed_chars: + print(untrusted_value) raise ProtocolError(error_message + repr(not_allowed_chars)) return untrusted_value result = ""