devices: drop DeviceInfo.options

It's part of DeviceAssignment class, here it was leftover from draft
API.
This commit is contained in:
Marek Marczykowski-Górecki 2018-09-18 21:54:51 +02:00
parent bf240cc928
commit a8c24bee0f
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 2 additions and 8 deletions

View File

@ -77,7 +77,7 @@ class DeviceInfo(object):
''' Holds all information about a device '''
# pylint: disable=too-few-public-methods
def __init__(self, backend_domain, devclass, ident, description=None,
options=None, **kwargs):
**kwargs):
#: domain providing this device
self.backend_domain = backend_domain
#: device class
@ -86,7 +86,6 @@ class DeviceInfo(object):
self.ident = ident
#: human readable description/name of the device
self.description = description
self.options = options or dict()
self.data = kwargs
def __hash__(self):
@ -233,7 +232,7 @@ class DeviceCollection(object):
for info_single in info.split(' ') if info_single)
yield DeviceInfo(self._vm, self._class, ident,
description=description,
options=None, **info_dict)
**info_dict)
def update_persistent(self, device, persistent):
'''Update `persistent` flag of already attached device.

View File

@ -42,7 +42,6 @@ class TC_00_DeviceCollection(qubesadmin.tests.QubesTestCase):
self.assertEqual(dev.backend_domain, self.vm)
self.assertEqual(dev.ident, 'dev1')
self.assertEqual(dev.description, '')
self.assertEqual(dev.options, {})
self.assertEqual(dev.data, {})
self.assertEqual(str(dev), 'test-vm:dev1')
self.assertAllCalled()
@ -58,7 +57,6 @@ class TC_00_DeviceCollection(qubesadmin.tests.QubesTestCase):
self.assertEqual(dev.backend_domain, self.vm)
self.assertEqual(dev.ident, 'dev1')
self.assertEqual(dev.description, 'This is description')
self.assertEqual(dev.options, {})
self.assertEqual(dev.data, {})
self.assertEqual(str(dev), 'test-vm:dev1')
@ -73,7 +71,6 @@ class TC_00_DeviceCollection(qubesadmin.tests.QubesTestCase):
self.assertEqual(dev.backend_domain, self.vm)
self.assertEqual(dev.ident, 'dev1')
self.assertEqual(dev.description, 'This is description')
self.assertEqual(dev.options, {})
self.assertEqual(dev.data, {'ro': 'True', 'other': '123'})
self.assertEqual(str(dev), 'test-vm:dev1')
self.assertAllCalled()
@ -87,7 +84,6 @@ class TC_00_DeviceCollection(qubesadmin.tests.QubesTestCase):
self.assertEqual(dev.backend_domain, self.vm)
self.assertEqual(dev.ident, 'dev1')
self.assertEqual(dev.description, 'This is description')
self.assertEqual(dev.options, {})
self.assertEqual(dev.data, {})
self.assertEqual(str(dev), 'test-vm:dev1')
self.assertAllCalled()
@ -101,7 +97,6 @@ class TC_00_DeviceCollection(qubesadmin.tests.QubesTestCase):
self.assertEqual(dev.backend_domain, self.vm)
self.assertEqual(dev.ident, 'dev2')
self.assertEqual(dev.description, 'Unknown device')
self.assertEqual(dev.options, {})
self.assertEqual(dev.data, {})
self.assertEqual(str(dev), 'test-vm:dev2')
self.assertAllCalled()