From 72e9c562afab616dbd0f87fef1676b4381de987c Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 4 Oct 2023 01:11:32 +0200 Subject: [PATCH] ceph-volume: fix util.get_partitions The current logic makes it report only the first partitions of devices. Fixes: https://tracker.ceph.com/issues/63086 Signed-off-by: Guillaume Abrioux (cherry picked from commit b14ff07e6344d9f097259265d468f6300818b053) --- src/ceph-volume/ceph_volume/util/disk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ceph-volume/ceph_volume/util/disk.py b/src/ceph-volume/ceph_volume/util/disk.py index 7148612f329..2c124d2da25 100644 --- a/src/ceph-volume/ceph_volume/util/disk.py +++ b/src/ceph-volume/ceph_volume/util/disk.py @@ -802,7 +802,7 @@ def get_partitions(_sys_dev_block_path ='/sys/dev/block'): result = dict() for device in devices: device_path = os.path.join(_sys_dev_block_path, device) - is_partition = get_file_contents(os.path.join(device_path, 'partition')) == "1" + is_partition = int(get_file_contents(os.path.join(device_path, 'partition'), '0')) > 0 if not is_partition: continue -- 2.39.5