]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: avoid calling zap_lv with a LV-less VG 33297/head
authorJan Fajerski <jfajerski@suse.com>
Thu, 13 Feb 2020 16:09:44 +0000 (17:09 +0100)
committerJan Fajerski <jfajerski@suse.com>
Fri, 14 Feb 2020 07:47:48 +0000 (08:47 +0100)
Fixes: https://tracker.ceph.com/issues/44125
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit ad0dea53b8585d8397bf3069b1b39f13b6e0a8ce)

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

index 6e60614088d0f19d3731c75cd38a4033baa08825..6ccc3892d26beff076a019ff732f052202be78ef 100644 (file)
@@ -223,7 +223,13 @@ class Zap(object):
         Requirements: An LV or VG present in the device, making it an LVM member
         """
         for lv in device.lvs:
-            self.zap_lv(Device(lv.lv_path))
+            if lv.lv_name:
+                mlogger.info('Zapping lvm member {}. lv_path is {}'.format(device.abspath, lv.lv_path))
+                self.zap_lv(Device(lv.lv_path))
+            else:
+                mlogger.info('Found empty VG {}, removing'.format(lv.vg_name))
+                api.remove_vg(lv.vg_name)
+
 
 
     def zap_raw_device(self, device):