]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
ceph-volume: fix partitions support in disk.get_devices()
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 12:13:25 +0000 (13:13 +0100)
commitd5d2d1456542829495d3ebbbad6ca2febd7c344d
tree0fa3d628f4208bcfcf57b333ff0d2319ef53d64c
parent956305eb5caf323cfadb772a9a1f910a90aa7740
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.

Fixes: https://tracker.ceph.com/issues/64195
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit f72100bbd17539d9774ae72215afefee16f20775)
src/ceph-volume/ceph_volume/util/device.py
src/ceph-volume/ceph_volume/util/disk.py