Skip to content
Snippets Groups Projects
Commit 818db5cb authored by Thomas Woerner's avatar Thomas Woerner
Browse files

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)
parent 25495d1e
No related branches found
No related tags found
No related merge requests found
......@@ -327,6 +327,9 @@ def main():
validate_domain_name(options.domain_name)
if options.realm_name:
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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment