Skip to content

Commit bfa8bd1

Browse files
authored
Merge pull request ceph#50745 from guits/quick-fix-cv
ceph-volume: quick fix in zap.py
2 parents d9e6e1d + a666f70 commit bfa8bd1

File tree

1 file changed

+3
-2
lines changed
  • src/ceph-volume/ceph_volume/devices/lvm

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def zap_lv(self, device):
168168
"""
169169
lv = api.get_single_lv(filters={'lv_name': device.lv_name, 'vg_name':
170170
device.vg_name})
171-
pv = api.get_single_pv(filters={'lv_uuid': lv.lv_uuid})
172171
self.unmount_lv(lv)
173172

174173
wipefs(device.path)
@@ -182,8 +181,10 @@ def zap_lv(self, device):
182181
elif len(lvs) <= 1:
183182
mlogger.info('Only 1 LV left in VG, will proceed to destroy '
184183
'volume group %s', device.vg_name)
184+
pvs = api.get_pvs(filters={'lv_uuid': lv.lv_uuid})
185185
api.remove_vg(device.vg_name)
186-
api.remove_pv(pv.pv_name)
186+
for pv in pvs:
187+
api.remove_pv(pv.pv_name)
187188
else:
188189
mlogger.info('More than 1 LV left in VG, will proceed to '
189190
'destroy LV only')

0 commit comments

Comments
 (0)