From: David Casier Date: Wed, 3 Jul 2019 21:24:34 +0000 (+0200) Subject: ceph-volume: lvm.activate: Return an error if WAL/DB devices absent X-Git-Tag: v15.1.0~2268^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=de439a0a236e4752e64a0cd63b7ce1ad3278eff3;p=ceph.git ceph-volume: lvm.activate: Return an error if WAL/DB devices absent Fixes: https://tracker.ceph.com/issues/40100 Signed-off-by: David Casier --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/activate.py b/src/ceph-volume/ceph_volume/devices/lvm/activate.py index c691fe7ace66..d46db9edfa58 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):