]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
ceph-volume: quick fix in zap.py
authorGuillaume Abrioux <gabrioux@ibm.com>
Wed, 29 Mar 2023 14:58:11 +0000 (16:58 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Mon, 24 Apr 2023 11:18:35 +0000 (13:18 +0200)
commitc3b680297668832eddd2d6570ac94ed57be1da67
tree9a80bacdef766f70c9c01b23d84b87a753248d9d
parent58a417695002d3ad89cfd7fce0e3445a8b02412c
ceph-volume: quick fix in zap.py

`api.get_single_pv(filters={'lv_uuid': lv.lv_uuid})` needs to be called
only if `--destroy` is passed in order to remove vg and pv when there's
nothing left.

With old deployments, it is possible that a lv_uuid matches more than 1
PV.
Given that `get_single_pv()` is only needed when `--destroy` is passed,
let's move this call where it is actually needed.

This makes `ceph-volume lvm zap` fail even though

Fixes: https://tracker.ceph.com/issues/59210
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit a666f700f16937565484dffc90713f6c04d76313)
src/ceph-volume/ceph_volume/devices/lvm/zap.py