storage/kernels: fix listing volumes

Pool.volumes property is implemented in a base class, individual drivers
should provide list_volumes() method as a backend for that property.
Fix this in a LinuxKernel pool.
This commit is contained in:
Marek Marczykowski-Górecki 2019-11-10 00:34:33 +01:00
parent 263f218d40
commit 77cf310c47
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 2 additions and 3 deletions

View File

@ -209,8 +209,7 @@ class LinuxKernel(Pool):
[pool for pool in app.pools.values() if pool is not self],
self.dir_path)
@property
def volumes(self):
def list_volumes(self):
''' Return all known kernel volumes '''
return [LinuxModules(self.dir_path,
kernel_version,

View File

@ -250,7 +250,7 @@ class TC_03_KernelPool(qubes.tests.QubesTestCase):
def test_002_pool_volumes(self):
""" List volumes """
volumes = self.app.pools[self.POOL_NAME].volumes
volumes = list(self.app.pools[self.POOL_NAME].volumes)
self.assertEqual(len(volumes), 1)
vol = volumes[0]
self.assertEqual(vol.vid, 'dummy')