]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix util.get_partitions
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 3 Oct 2023 23:11:32 +0000 (01:11 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Sat, 27 Jan 2024 12:11:40 +0000 (13:11 +0100)
The current logic makes it report only the first
partitions of devices.

Fixes: https://tracker.ceph.com/issues/63086
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit b14ff07e6344d9f097259265d468f6300818b053)

src/ceph-volume/ceph_volume/util/disk.py

index 7148612f3297665dd7a6c8170b19a7bb58776eea..2c124d2da25bac44635d5706646ec87b52649717 100644 (file)
@@ -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