From: Guillaume Abrioux Date: Tue, 3 Oct 2023 23:11:32 +0000 (+0200) Subject: ceph-volume: fix util.get_partitions X-Git-Tag: v18.2.4~322^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=72e9c562afab616dbd0f87fef1676b4381de987c;p=ceph.git 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) --- diff --git a/src/ceph-volume/ceph_volume/util/disk.py b/src/ceph-volume/ceph_volume/util/disk.py index 7148612f32976..2c124d2da25ba 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