]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
ceph-volume: do not convert LVs's symlink to real path
authorGuillaume Abrioux <gabrioux@ibm.com>
Thu, 4 Jul 2024 11:59:37 +0000 (11:59 +0000)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 2 Aug 2024 05:41:17 +0000 (05:41 +0000)
commit0f6ceb27fc8cb48c008e70bd59e3edd0e5f5708b
treef63e17f34640d7c149f959abec96c3001310cf06
parent5f37fe5c77e05b23f033944faebad3c1318f04e9
ceph-volume: do not convert LVs's symlink to real path

This commit:
- Adds a new function `get_lvm_mappers` in `ceph_volume/util/disk.py`
  to retrieve a list of LVM device mappers.
- Updates the `is_lv` property in `ceph_volume/util/device.py`
  to use the new `get_lvm_mappers` function for better accuracy.
- Modifies the symlink handling in `Device` class to properly
  identify LVM logical volumes.
- Adds a new test `test_reject_lv_symlink_to_device` to ensure
  LVM symlinks are correctly identified and handled.
- Updates relevant tests to cover the changes in LVM device detection.

These changes improve the reliability and accuracy of LVM device detection
and handling, ensuring that symlinks to LVM logical volumes are
correctly processed.

Fixes: https://tracker.ceph.com/issues/61597
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
Co-Authored-by: Jerry Pu <jerrypu@qnap.com>
(cherry picked from commit 729c5de4f852f1a1ee90e76b71157e9070af7d99)
src/ceph-volume/ceph_volume/tests/devices/lvm/test_migrate.py
src/ceph-volume/ceph_volume/tests/util/test_device.py
src/ceph-volume/ceph_volume/util/device.py
src/ceph-volume/ceph_volume/util/disk.py