Merge pull request #851 from rjeffman/dnszone_fix_bool_behavior

Fix handling of boolean values for FreeIPA 4.9.10+
This commit is contained in:
Thomas Woerner
2022-07-06 20:44:13 +02:00
committed by GitHub
8 changed files with 83 additions and 22 deletions

View File

@@ -88,9 +88,15 @@ else:
"""
Split a version string A.B.C, into a tuple.
This will not work for `rc`, `dev` or similar version string.
This will not work for `rc`, `dev` or similar.
"""
return tuple(re.split("[-_.]", version_str)) # noqa: W605
try:
_version = tuple(
(int(x) for x in re.split("[-_.]", version_str))
)
except ValueError:
_version = tuple(re.split("[-_.]", version_str))
return _version
from ipalib import api
from ipalib import errors as ipalib_errors # noqa
@@ -866,7 +872,10 @@ else:
# Check if param_name is actually a param
if param_name in self.ansible_module.params:
value = self.ansible_module.params_get(param_name)
if isinstance(value, bool):
if (
self.ansible_module.ipa_check_version("<", "4.9.10")
and isinstance(value, bool)
):
value = "TRUE" if value else "FALSE"
# Since param wasn't a param check if it's a method name