Skip to content

Commit ae31ae0

Browse files
authored
Merge pull request ceph#62173 from guits/fix-70363
ceph-volume: allow zapping partitions on multipath devices
2 parents 89d9348 + 16daa6a commit ae31ae0

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)