tests/lvm: fix checking lvm pool existence cont.

Commit 15cf593bc5 "tests/lvm: fix checking
lvm pool existence" attempted to fix handling '-' in pool name by using
/dev/VG/LV symlink. But those are not created for thin pools. Change
back to /dev/mapper, but include '-' mangling.

Related QubesOS/qubes-issues#4332
This commit is contained in:
Marek Marczykowski-Górecki 2018-11-11 01:22:46 +01:00
parent f023b3dd6e
commit d2585aa871
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -42,7 +42,9 @@ else:
def lvm_pool_exists(volume_group, thin_pool):
''' Returns ``True`` if thin pool exists in the volume group. '''
path = "/dev/{!s}/{!s}".format(volume_group, thin_pool)
path = "/dev/mapper/{!s}-{!s}".format(
volume_group.replace('-', '--'),
thin_pool.replace('-', '--'))
return os.path.exists(path)