lxc_container: use LVM runners from _lvm module utils (#11920)

* lxc_container: use LVM runners from _lvm module utils

Replace direct run_command calls for lvs, vgdisplay, lvdisplay,
lvcreate, and lvremove with the shared CmdRunner-based runners from
module_utils/_lvm.py. Switches from human-readable text parsing to
machine-readable --noheadings/--nosuffix/--separator output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* lxc_container: add changelog fragment for PR 11920

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* generate run_info information for commands

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexei Znamensky
2026-04-29 21:56:30 +12:00
committed by GitHub
parent d0f0e9d00f
commit 1f2e60f65d
3 changed files with 45 additions and 41 deletions

View File

@@ -179,7 +179,7 @@ def pvmove_runner(module: AnsibleModule, **kwargs) -> CmdRunner:
def vgs_runner(module: AnsibleModule, **kwargs) -> CmdRunner:
"""
Runner for C(vgs). Used by: community.general.lvol, community.general.lvg,
community.general.lvg_rename.
community.general.lvg_rename, community.general.lxc_container.
Suggested arg_formats keys: noheadings nosuffix readonly units separator fields select vg
"""
@@ -341,7 +341,7 @@ def vgrename_runner(module: AnsibleModule, **kwargs) -> CmdRunner:
def lvs_runner(module: AnsibleModule, **kwargs) -> CmdRunner:
"""
Runner for C(lvs). Used by: community.general.lvol.
Runner for C(lvs). Used by: community.general.lvol, community.general.lxc_container.
Suggested arg_formats keys: all noheadings nosuffix units separator fields select vg