From e4d7df4976a119500372745534adf666143979ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Fri, 15 May 2020 15:15:37 +0200 Subject: [PATCH] Prevent double hyphens in thin_pool parsing --- qubes/storage/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qubes/storage/__init__.py b/qubes/storage/__init__.py index 532b7926..959122b6 100644 --- a/qubes/storage/__init__.py +++ b/qubes/storage/__init__.py @@ -932,8 +932,13 @@ class DirectoryThinPool: .format(thin_pool_devnum), "r") as thin_pool_tpool_f: thin_pool_tpool = thin_pool_tpool_f.read().rstrip('\n') if thin_pool_tpool.endswith("-tpool"): + # LVM replaces '-' by '--' if name contains + # a hyphen + thin_pool_tpool = thin_pool_tpool.replace('--', '=') volume_group, thin_pool, _tpool = \ thin_pool_tpool.rsplit("-", 2) + volume_group = volume_group.replace('=', '-') + thin_pool = thin_pool.replace('=', '-') cls._thin_pool[dir_path] = volume_group, thin_pool except: # pylint: disable=bare-except pass