]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: lvm.activate: Return an error if WAL/DB devices absent 29038/head
authorDavid Casier <david.casier@aevoo.fr>
Wed, 3 Jul 2019 21:24:34 +0000 (23:24 +0200)
committerAlfredo Deza <alfredo@deza.pe>
Thu, 12 Sep 2019 19:01:50 +0000 (15:01 -0400)
Fixes: https://tracker.ceph.com/issues/40100
Signed-off-by: David Casier <david.casier@aevoo.fr>
(cherry picked from commit de439a0a236e4752e64a0cd63b7ce1ad3278eff3)

src/ceph-volume/ceph_volume/devices/lvm/activate.py

index 1ad15bc80a81c2386129da98e9fcb848e5ab8cc0..2ff5a094365956dbc9e598136dbeb0f13f877fda 100644 (file)
@@ -109,14 +109,16 @@ def get_osd_device_path(osd_lv, lvs, device_type, dmcrypt_secret=None):
             encryption_utils.luks_open(dmcrypt_secret, device_lv.lv_path, device_uuid)
             return '/dev/mapper/%s' % device_uuid
         return device_lv.lv_path
-    else:
-        # this could be a regular device, so query it with blkid
-        physical_device = disk.get_device_from_partuuid(device_uuid)
-        if physical_device and is_encrypted:
+
+    # this could be a regular device, so query it with blkid
+    physical_device = disk.get_device_from_partuuid(device_uuid)
+    if physical_device:
+        if is_encrypted:
             encryption_utils.luks_open(dmcrypt_secret, physical_device, device_uuid)
             return '/dev/mapper/%s' % device_uuid
-        return physical_device or None
-    return None
+        return physical_device
+
+    raise RuntimeError('could not find %s with uuid %s' % (device_type, device_uuid))
 
 
 def activate_bluestore(lvs, no_systemd=False):