]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume/batch: check lvs list before access 34463/head
authorJan Fajerski <jfajerski@suse.com>
Wed, 8 Apr 2020 08:41:56 +0000 (10:41 +0200)
committerJan Fajerski <jfajerski@suse.com>
Wed, 8 Apr 2020 08:41:56 +0000 (10:41 +0200)
Fixes: https://tracker.ceph.com/issues/44989
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
src/ceph-volume/ceph_volume/devices/lvm/batch.py

index 27ee5bb47e006f4bc9d5aa5252c1b21a9f4c91c1..84cbfad554b3de0222c83fb680fb5a8213928b89 100644 (file)
@@ -106,9 +106,12 @@ def filter_devices(args):
     if len(unused_devices) == 1:
         last_device = unused_devices[0]
         if not last_device.rotational and last_device.is_lvm_member:
-            reason = "Used by ceph as a %s already and there are no devices left for data/block" % (
-                last_device.lvs[0].tags.get("ceph.type"),
-            )
+            if last_device.lvs:
+                reason = "Used by ceph as a %s already and there are no devices left for data/block" % (
+                    last_device.lvs[0].tags.get("ceph.type"),
+                )
+            else:
+                reason = "Disk is an LVM member already, skipping"
             filtered_devices[last_device.abspath] = {"reasons": [reason]}
             logger.info(reason + ": %s" % last_device.abspath)
             unused_devices = []