Fix errors when ipaservers variable is not set

This commit is contained in:
Brant Evans
2019-05-08 16:08:24 -06:00
parent 0ddd62ea01
commit 34ce174d55

View File

@@ -306,7 +306,8 @@ def main():
# Get domain from first server if domain is not set, but if there are # Get domain from first server if domain is not set, but if there are
# servers # servers
if options.domain_name is None and len(options.servers) > 0: if options.domain_name is None and options.servers is not None:
if len(options.servers) > 0:
options.domain_name = options.servers[0][options.servers[0].find(".")+1:] options.domain_name = options.servers[0][options.servers[0].find(".")+1:]
try: try:
@@ -324,6 +325,7 @@ def main():
### ServiceInstallInterface ### ### ServiceInstallInterface ###
if options.domain_name:
validate_domain_name(options.domain_name) validate_domain_name(options.domain_name)
if options.realm_name: if options.realm_name: