]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: fix partitions support in disk.get_devices() 54423/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Fri, 26 Jan 2024 20:35:18 +0000 (21:35 +0100)
committerGuillaume Abrioux <gabrioux@ibm.com>
Sat, 27 Jan 2024 00:29:19 +0000 (01:29 +0100)
commitf72100bbd17539d9774ae72215afefee16f20775
treef31a0ba4645a795ab2485b5456fcbb7bb1fd9c61
parent0985e201342fa53c014a811156aed661b4b8f994
ceph-volume: fix partitions support in disk.get_devices()

The following:
```
is_part = get_file_contents(os.path.join(_sys_dev_block_path, item, 'partition')) == "1"
```
assumes any `/sys/dev/block/x:y/partition` contains '1' which is wrong.
This file actually contains the corresponding partition number.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
src/ceph-volume/ceph_volume/util/device.py
src/ceph-volume/ceph_volume/util/disk.py