]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: allow zapping partitions on multipath devices 62178/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Fri, 7 Mar 2025 16:23:02 +0000 (17:23 +0100)
committerGuillaume Abrioux <gabrioux@ibm.com>
Sun, 9 Mar 2025 08:50:02 +0000 (08:50 +0000)
ceph-volume refuses to zap a device if it is a partition on a multipath
device due to an overly strict condition. This change ensures that only
full mapper devices (excluding partitions) are blocked from being zapped,
allowing partitions on multipath devices to be processed correctly.

Fixes: https://tracker.ceph.com/issues/70363
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit 16daa6a687c0536324b06536af12ce4e8fc04087)

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

index f512a3bde1d7cef96e9a840e1f020eb2df946410..780173209839e78912698e88f10c8644d98defb8 100644 (file)
@@ -272,7 +272,7 @@ class Zap(object):
 
         for device in devices:
             mlogger.info("Zapping: %s", device.path)
-            if device.is_mapper and not device.is_mpath:
+            if device.is_mapper and not device.is_mpath and not device.is_partition:
                 terminal.error("Refusing to zap the mapper device: {}".format(device))
                 raise SystemExit(1)
             if device.is_lvm_member:
index 745b58ae55a2e49ddb7b0a08f3d4b1a955c79166..6d4019245d49c88522ebcdcbbae863ef32a73326 100644 (file)
@@ -30,7 +30,8 @@ class TestZap(object):
             exists=True,
             has_partitions=False,
             has_gpt_headers=False,
-            has_fs=False
+            has_fs=False,
+            is_partition=False
         )
         with pytest.raises(SystemExit):
             lvm.zap.Zap(argv=[device_name]).main()