From 308a5d7e06ebb8f2dff50a7bd9b549bdc5f5676b Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 22:01:28 +0200 Subject: [PATCH] [PR #11823/71723268 backport][stable-12] lvol: fix LVM version regex to handle date formats without dashes (#11831) lvol: fix LVM version regex to handle date formats without dashes (#11823) * lvol: fix LVM version regex to handle date formats without dashes Fixes #5445 * lvol: add changelog fragment for issue 5445 --------- (cherry picked from commit 7172326868bfd51dec47e401cd773554b5ec4513) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 --- changelogs/fragments/11823-lvol-lvm-version-regex.yml | 2 ++ plugins/modules/lvol.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/11823-lvol-lvm-version-regex.yml diff --git a/changelogs/fragments/11823-lvol-lvm-version-regex.yml b/changelogs/fragments/11823-lvol-lvm-version-regex.yml new file mode 100644 index 0000000000..23b08222ea --- /dev/null +++ b/changelogs/fragments/11823-lvol-lvm-version-regex.yml @@ -0,0 +1,2 @@ +bugfixes: + - lvol - fix LVM version parsing (https://github.com/ansible-collections/community.general/issues/5445, https://github.com/ansible-collections/community.general/pull/11823). diff --git a/plugins/modules/lvol.py b/plugins/modules/lvol.py index 5bbfb7ea75..33b1e3bf69 100644 --- a/plugins/modules/lvol.py +++ b/plugins/modules/lvol.py @@ -277,7 +277,7 @@ def get_lvm_version(module): rc, out, err = module.run_command([ver_cmd, "version"]) if rc != 0: return None - m = re.search(r"LVM version:\s+(\d+)\.(\d+)\.(\d+).*(\d{4}-\d{2}-\d{2})", out) + m = re.search(r"LVM version:\s+(\d+)\.(\d+)\.(\d+)", out) if not m: return None return mkversion(m.group(1), m.group(2), m.group(3))