]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix util.get_partitions 53804/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 3 Oct 2023 23:11:32 +0000 (01:11 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Tue, 3 Oct 2023 23:11:32 +0000 (01:11 +0200)
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>
src/ceph-volume/ceph_volume/util/disk.py

index ee061b724007819a5d059c0db2d96f7052d5c38f..704b9e76600c0a21fced8d372e46abaf8a6280cf 100644 (file)
@@ -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