From 42d62bb47e4075ed720fee857745dd0934a149ef Mon Sep 17 00:00:00 2001 From: 3hhh Date: Wed, 15 Jul 2020 18:16:54 +0200 Subject: [PATCH] storage/lvm: make the "hack" work with CallbackPool instances CallbackPool instances are no ThinPool instances, but behave identically, if their backend driver is a ThinPool instance. --- qubes/storage/lvm.py | 2 +- qubes/tests/storage_lvm.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/qubes/storage/lvm.py b/qubes/storage/lvm.py index aab81667..99a89f47 100644 --- a/qubes/storage/lvm.py +++ b/qubes/storage/lvm.py @@ -509,7 +509,7 @@ class ThinVolume(qubes.storage.Volume): # HACK: neat trick to speed up testing if you have same physical thin # pool assigned to two qubes-pools i.e: qubes_dom0 and test-lvm # pylint: disable=line-too-long - if isinstance(src_volume.pool, ThinPool) and \ + if hasattr(src_volume.pool, 'thin_pool') and \ src_volume.pool.thin_pool == self.pool.thin_pool: # NOQA yield from self._commit(src_volume.path[len('/dev/'):], keep=True) else: diff --git a/qubes/tests/storage_lvm.py b/qubes/tests/storage_lvm.py index 2d1d1e69..aa11fcd2 100644 --- a/qubes/tests/storage_lvm.py +++ b/qubes/tests/storage_lvm.py @@ -792,8 +792,7 @@ class TC_00_ThinPool(ThinPoolBase): # also should be different than source volume (clone, not the same LV) self.assertNotEqual(uuid_after, source_uuid) - if VOLUME_CLASS == ThinVolume: - self.assertEqual(self._get_lv_origin_uuid(volume.path), source_uuid) + self.assertEqual(self._get_lv_origin_uuid(volume.path), source_uuid) expected_revisions = { '1521065906-back': '2018-03-14T22:18:26',