Skip to content

Commit

Permalink
storage/lvm: make the "hack" work with CallbackPool instances
Browse files Browse the repository at this point in the history
CallbackPool instances are no ThinPool instances, but behave
identically, if their backend driver is a ThinPool instance.
  • Loading branch information
3hhh committed Jul 16, 2020
1 parent 409ea88 commit 42d62bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion qubes/storage/lvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def import_volume(self, src_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:
Expand Down
3 changes: 1 addition & 2 deletions qubes/tests/storage_lvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,7 @@ def test_032_import_volume_same_pool(self):

# 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',
Expand Down

0 comments on commit 42d62bb

Please sign in to comment.