block: fix handling non-existing devices
Don't yield None as DeviceInfo object. The device-get: event handlers are expecte to yield anything only when there is a device.
This commit is contained in:
parent
f6d10ec243
commit
fd5aaa8866
@ -162,7 +162,9 @@ class BlockDeviceExtension(qubes.ext.Extension):
|
|||||||
if not vm.is_running():
|
if not vm.is_running():
|
||||||
return
|
return
|
||||||
if not vm.app.vmm.offline_mode:
|
if not vm.app.vmm.offline_mode:
|
||||||
yield self.device_get(vm, ident)
|
device_info = self.device_get(vm, ident)
|
||||||
|
if device_info:
|
||||||
|
yield device_info
|
||||||
|
|
||||||
@qubes.ext.handler('device-list-attached:block')
|
@qubes.ext.handler('device-list-attached:block')
|
||||||
def on_device_list_attached(self, vm, event, **kwargs):
|
def on_device_list_attached(self, vm, event, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user