From: Guillaume Abrioux Date: Tue, 3 Oct 2023 23:11:32 +0000 (+0200) Subject: ceph-volume: fix util.get_partitions X-Git-Tag: v17.2.8~427^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5845ed2510242531f8477206045724fca354b6df;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 e5e568cd0387..abd28b5652db 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