mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
[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 7172326868)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2
changelogs/fragments/11823-lvol-lvm-version-regex.yml
Normal file
2
changelogs/fragments/11823-lvol-lvm-version-regex.yml
Normal file
@@ -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).
|
||||||
@@ -277,7 +277,7 @@ def get_lvm_version(module):
|
|||||||
rc, out, err = module.run_command([ver_cmd, "version"])
|
rc, out, err = module.run_command([ver_cmd, "version"])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
return None
|
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:
|
if not m:
|
||||||
return None
|
return None
|
||||||
return mkversion(m.group(1), m.group(2), m.group(3))
|
return mkversion(m.group(1), m.group(2), m.group(3))
|
||||||
|
|||||||
Reference in New Issue
Block a user