From a04ee601636fc2deedabd60e628920d17b7e1555 Mon Sep 17 00:00:00 2001 From: David Casier Date: Wed, 3 Jul 2019 23:24:34 +0200 Subject: [PATCH] ceph-volume: lvm.activate: Return an error if WAL/DB devices absent Fixes: https://tracker.ceph.com/issues/40100 Signed-off-by: David Casier (cherry picked from commit de439a0a236e4752e64a0cd63b7ce1ad3278eff3) --- .../ceph_volume/devices/lvm/activate.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ceph-volume/ceph_volume/devices/lvm/activate.py b/src/ceph-volume/ceph_volume/devices/lvm/activate.py index 1ad15bc80a81c..2ff5a09436595 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/activate.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/activate.py @@ -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): -- 2.39.5