]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: Introduce new `Lvm` base class to unify LVM object handling
authorGuillaume Abrioux <gabrioux@ibm.com>
Mon, 3 Mar 2025 07:21:23 +0000 (08:21 +0100)
committerGuillaume Abrioux <gabrioux@ibm.com>
Mon, 3 Mar 2025 09:46:10 +0000 (10:46 +0100)
commitfc085405abe33023f67b7e5592b6e0eddcc097f8
tree602a53cb6c33456d89041ff6fb01da5a10d4cf3e
parent3e9ff5cc1afcfc9ebb6e7b6b460ecfc12f6fc100
ceph-volume: Introduce new `Lvm` base class to unify LVM object handling

This commit introduces a new `Lvm` base class to streamline LVM related objects
(`PVolume`, `VolumeGroup`, and `Volume`) by consolidating shared logic.

Key changes:
- `Lvm` centralizes common attributes like `name`, `tags`, `path`, and `binary_change`.
- `clear_tags`, `clear_tag`, `set_tag`, and `set_tags` are now defined in `Lvm`,
  reducing code duplication.
- `PVolume`, `VolumeGroup`, and `Volume` inherit from `Lvm`,
  simplifying their constructors.
- The redundant `_format_tag_args` and tag manipulation methods in
  child classes are removed.

This refactor improves maintainability by reducing code duplication
while preserving the existing API behavior.

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