Devices-related formating fixes
QubesOS/qubes-issues#
This commit is contained in:
parent
dde9085920
commit
fe37e0933e
@ -867,8 +867,9 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
|
|||||||
devclass=devclass, persistent=persistent,
|
devclass=devclass, persistent=persistent,
|
||||||
options=options)
|
options=options)
|
||||||
|
|
||||||
assignment = qubes.devices.DeviceAssignment(dev.backend_domain,
|
assignment = qubes.devices.DeviceAssignment(
|
||||||
dev.ident, options=options, persistent=persistent)
|
dev.backend_domain, dev.ident,
|
||||||
|
options=options, persistent=persistent)
|
||||||
self.dest.devices[devclass].attach(assignment)
|
self.dest.devices[devclass].attach(assignment)
|
||||||
self.app.save()
|
self.app.save()
|
||||||
|
|
||||||
@ -889,7 +890,7 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
|
|||||||
self.fire_event_for_permission(device=dev,
|
self.fire_event_for_permission(device=dev,
|
||||||
devclass=devclass)
|
devclass=devclass)
|
||||||
|
|
||||||
assignment = qubes.devices.DeviceAssignment(dev.backend_domain,
|
assignment = qubes.devices.DeviceAssignment(
|
||||||
dev.ident)
|
dev.backend_domain, dev.ident)
|
||||||
self.dest.devices[devclass].detach(assignment)
|
self.dest.devices[devclass].detach(assignment)
|
||||||
self.app.save()
|
self.app.save()
|
||||||
|
@ -81,8 +81,8 @@ class TC_00_DeviceCollection(qubes.tests.QubesTestCase):
|
|||||||
self.device = self.emitter.device
|
self.device = self.emitter.device
|
||||||
self.collection = self.emitter.devices['testclass']
|
self.collection = self.emitter.devices['testclass']
|
||||||
self.assignment = qubes.devices.DeviceAssignment(
|
self.assignment = qubes.devices.DeviceAssignment(
|
||||||
backend_domain = self.device.backend_domain,
|
backend_domain=self.device.backend_domain,
|
||||||
ident = self.device.ident,
|
ident=self.device.ident,
|
||||||
persistent=True
|
persistent=True
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -161,7 +161,10 @@ class TC_01_DeviceManager(qubes.tests.QubesTestCase):
|
|||||||
|
|
||||||
def test_001_missing(self):
|
def test_001_missing(self):
|
||||||
device = TestDevice(self.emitter.app.domains['vm'], 'testdev')
|
device = TestDevice(self.emitter.app.domains['vm'], 'testdev')
|
||||||
assignment = qubes.devices.DeviceAssignment(backend_domain=device.backend_domain, ident=device.ident, persistent=True)
|
assignment = qubes.devices.DeviceAssignment(
|
||||||
|
backend_domain=device.backend_domain,
|
||||||
|
ident=device.ident,
|
||||||
|
persistent=True)
|
||||||
self.manager['testclass'].attach(assignment)
|
self.manager['testclass'].attach(assignment)
|
||||||
self.assertEventFired(self.emitter, 'device-attach:testclass')
|
self.assertEventFired(self.emitter, 'device-attach:testclass')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user