mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 05:43:26 +00:00
ipa[client,server]: Inspect validate_domain_name for 4.6 and prior
The entity argument for validate_domain_name is only available in FreeIPA 4.7 and later. This has been fixed using inspect to be able to detect if entity is a valid argument. If not the whole realm name check is skipped. Related: #61 (ipaserver role - Fails on ipaclient install) Fixes: #66 (Python 2 error with validate_domain)
This commit is contained in:
@@ -327,7 +327,10 @@ def main():
|
||||
validate_domain_name(options.domain_name)
|
||||
|
||||
if options.realm_name:
|
||||
validate_domain_name(options.realm_name, entity="realm")
|
||||
argspec = inspect.getargspec(validate_domain_name)
|
||||
if "entity" in argspec.args:
|
||||
# NUM_VERSION >= 40690:
|
||||
validate_domain_name(options.realm_name, entity="realm")
|
||||
|
||||
### ClientInstallInterface ###
|
||||
|
||||
|
||||
@@ -565,7 +565,9 @@ def main():
|
||||
if not options.realm_name:
|
||||
options.realm_name = options.domain_name
|
||||
options.realm_name = options.realm_name.upper()
|
||||
if NUM_VERSION >= 40690:
|
||||
argspec = inspect.getargspec(validate_domain_name)
|
||||
if "entity" in argspec.args:
|
||||
# NUM_VERSION >= 40690:
|
||||
try:
|
||||
validate_domain_name(options.realm_name, entity="realm")
|
||||
except ValueError as e:
|
||||
|
||||
Reference in New Issue
Block a user