From: Guillaume Abrioux Date: Tue, 3 Oct 2023 23:11:32 +0000 (+0200) Subject: ceph-volume: fix util.get_partitions X-Git-Tag: testing/wip-batrick-testing-20240411.154038~809^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b14ff07e6344d9f097259265d468f6300818b053;p=ceph-ci.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 --- diff --git a/src/ceph-volume/ceph_volume/util/disk.py b/src/ceph-volume/ceph_volume/util/disk.py index ee061b72400..704b9e76600 100644 --- a/src/ceph-volume/ceph_volume/util/disk.py +++ b/src/ceph-volume/ceph_volume/util/disk.py @@ -816,7 +816,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