From 25a66030597978d91fcc6978356bfd872bb1cd38 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 08:01:04 +0200 Subject: [PATCH] [PR #8175/b674f94f backport][stable-7] module_utils/ipa.py: fix regex when parsing version (#8205) module_utils/ipa.py: fix regex when parsing version (#8175) * module_utils/ipa.py: fix regex when parsing version * add changelog fragments * Update changelogs/fragments/8175-get_ipa_version_regex.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Dmitriy Usachev Co-authored-by: Felix Fontein (cherry picked from commit b674f94f646e3050eebd2fb1322ef93a1eb98a83) Co-authored-by: Dmitriy Usachev --- changelogs/fragments/8175-get_ipa_version_regex.yml | 2 ++ plugins/module_utils/ipa.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/8175-get_ipa_version_regex.yml diff --git a/changelogs/fragments/8175-get_ipa_version_regex.yml b/changelogs/fragments/8175-get_ipa_version_regex.yml new file mode 100644 index 0000000000..e2a51d1b91 --- /dev/null +++ b/changelogs/fragments/8175-get_ipa_version_regex.yml @@ -0,0 +1,2 @@ +bugfixes: + - ipa - fix get version regex in IPA module_utils (https://github.com/ansible-collections/community.general/pull/8175). diff --git a/plugins/module_utils/ipa.py b/plugins/module_utils/ipa.py index eda9b4132b..fb63d5556b 100644 --- a/plugins/module_utils/ipa.py +++ b/plugins/module_utils/ipa.py @@ -104,7 +104,7 @@ class IPAClient(object): def get_ipa_version(self): response = self.ping()['summary'] - ipa_ver_regex = re.compile(r'IPA server version (\d\.\d\.\d).*') + ipa_ver_regex = re.compile(r'IPA server version (\d+\.\d+\.\d+).*') version_match = ipa_ver_regex.match(response) ipa_version = None if version_match: