Skip to content

Commit

Permalink
ceph-volume: avoid calling zap_lv with a LV-less VG
Browse files Browse the repository at this point in the history
Fixes: https://tracker.ceph.com/issues/44125

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit ad0dea5)
  • Loading branch information
Jan Fajerski committed Feb 14, 2020
1 parent 10a8372 commit 4e6231f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ceph-volume/ceph_volume/devices/lvm/zap.py
Expand Up @@ -223,7 +223,13 @@ def zap_lvm_member(self, device):
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):
Expand Down

0 comments on commit 4e6231f

Please sign in to comment.