Skip to content

Commit 16daa6a

Browse files
committed
ceph-volume: allow zapping partitions on multipath devices
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 <[email protected]>
1 parent 6efaea3 commit 16daa6a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def zap(self) -> None:
398398
devices = self.args.devices
399399
for device in devices:
400400
mlogger.info("Zapping: %s", device.path)
401-
if device.is_mapper and not device.is_mpath:
401+
if device.is_mapper and not device.is_mpath and not device.is_partition:
402402
terminal.error("Refusing to zap the mapper device: {}".format(device))
403403
raise SystemExit(1)
404404
if device.is_lvm_member:

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def test_can_not_zap_mapper_device(self, mocked_device, monkeypatch, device_info
3030
exists=True,
3131
has_partitions=False,
3232
has_gpt_headers=False,
33-
has_fs=False
33+
has_fs=False,
34+
is_partition=False
3435
)
3536
with pytest.raises(SystemExit):
3637
lvm.zap.Zap(argv=[device_name]).main()

0 commit comments

Comments
 (0)