]> git-server-git.apps.pok.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>
Thu, 20 Feb 2025 12:14:47 +0000 (12:14 +0000)
commit8d8f203caef526bb68a21498650d329d94ba5ea9
tree4f5b4d0dff6dc49e82254cbc3422934e7fad8645
parent6020de32c896a6a4ebc918a35571ed71df78f5b7
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>
src/ceph-volume/ceph_volume/tests/util/test_disk.py
src/ceph-volume/ceph_volume/util/disk.py