]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume devices.lvm zap should skip when lv_uuid doesn't exist
authorAlfredo Deza <adeza@redhat.com>
Tue, 21 Aug 2018 14:58:44 +0000 (10:58 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 24 Aug 2018 14:18:04 +0000 (10:18 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/devices/lvm/zap.py

index b640f76d4a94388b6797c1a0668b0877a1cafb67..128470720923c313eb078410da7f8da5cad86f33 100644 (file)
@@ -50,7 +50,7 @@ class Zap(object):
         if lv.tags.get('ceph.cluster_name') and lv.tags.get('ceph.osd_id'):
             lv_path = "/var/lib/ceph/osd/{}-{}".format(lv.tags['ceph.cluster_name'], lv.tags['ceph.osd_id'])
         else:
-            lv_path = lv.path
+            lv_path = lv.lv_path
         dmcrypt_uuid = lv.lv_uuid
         dmcrypt = lv.encrypted
         if system.path_is_mounted(lv_path):
@@ -89,7 +89,9 @@ class Zap(object):
         vgs = set([pv.vg_name for pv in pvs])
         for pv in pvs:
             vg_name = pv.vg_name
-            lv = api.get_lv(vg_name=vg_name, lv_uuid=pv.lv_uuid)
+            lv = None
+            if pv.lv_uuid:
+                lv = api.get_lv(vg_name=vg_name, lv_uuid=pv.lv_uuid)
 
             if lv:
                 self.unmount_lv(lv)