Skip to content

Commit

Permalink
q-dev: update device_protocol.py
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Aug 27, 2024
1 parent 4b92aea commit 170894e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions qubesadmin/device_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def clone(self, **kwargs) -> 'VirtualDevice':
"device_id": self.device_id,
}
attr.update(kwargs)
return self.__class__(**attr)
return VirtualDevice(**attr)

@property
def port(self) -> Union[Port, str]:
Expand Down Expand Up @@ -1211,8 +1211,7 @@ def device(self) -> DeviceInfo:
return devices[0]
if len(devices) > 1:
raise ProtocolError("Too many devices matches to assignment")
if len(devices) == 0:
raise ProtocolError("Any devices matches to assignment")
raise ProtocolError("Any devices matches to assignment")

@property
def port(self) -> Port:
Expand Down

0 comments on commit 170894e

Please sign in to comment.