]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: enhance BlockSysFs
authorGuillaume Abrioux <gabrioux@ibm.com>
Mon, 10 Feb 2025 16:29:04 +0000 (16:29 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Mon, 24 Feb 2025 11:56:13 +0000 (11:56 +0000)
commitdcffc71c2baf79b780ac73646b9c537da3db8c5e
tree94d760d918f5ec0cab71ee4bc439e04676adcba1
parent0af9e1110c28df217c83fd2b1b86ce5c124aa1de
ceph-volume: enhance BlockSysFs

This refactores `BlockSysFs` to introduce `_get_sysfs_file_content()` for
retrieving sysfs file contents in a cleaner and reusable way.

It renames `self.sys_dev_block` to `self.sys_dev_block_dir` for clarity.
I've added `_get_sysfs_file_content()` to centralize sysfs file reads.

3 new methodes are introduced:
`blocks`, `logical_block_size`, and `size` properties for computing block
device size in a structured manner.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit 8d8f203caef526bb68a21498650d329d94ba5ea9)
src/ceph-volume/ceph_volume/tests/util/test_disk.py
src/ceph-volume/ceph_volume/util/disk.py