From 77cf310c47b67dd4d61e448e70ccebe21871ed10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 10 Nov 2019 00:34:33 +0100 Subject: [PATCH] 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. --- qubes/storage/kernels.py | 3 +-- qubes/tests/storage_kernels.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/qubes/storage/kernels.py b/qubes/storage/kernels.py index 448057b1..b12d8663 100644 --- a/qubes/storage/kernels.py +++ b/qubes/storage/kernels.py @@ -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, diff --git a/qubes/tests/storage_kernels.py b/qubes/tests/storage_kernels.py index 1c035fb1..9b7fa5ff 100644 --- a/qubes/tests/storage_kernels.py +++ b/qubes/tests/storage_kernels.py @@ -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')