mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipa-client-install hangs if the discovered server is unresponsive
Add a timeout to the wget call to cover a case when autodiscovered server does not response to our attempt to download ca.crt. Let user specify a different IPA server in that case. https://fedorahosted.org/freeipa/ticket/1960
This commit is contained in:
parent
2aa63fe4a9
commit
17f247d6c2
@ -797,7 +797,8 @@ def install(options, env, fstore, statestore):
|
|||||||
if ret == ipadiscovery.NOT_FQDN:
|
if ret == ipadiscovery.NOT_FQDN:
|
||||||
print >>sys.stderr, "%s is not a fully-qualified hostname" % hostname
|
print >>sys.stderr, "%s is not a fully-qualified hostname" % hostname
|
||||||
return CLIENT_INSTALL_ERROR
|
return CLIENT_INSTALL_ERROR
|
||||||
if ret == ipadiscovery.NO_LDAP_SERVER or not ds.getDomainName():
|
if ret in (ipadiscovery.NO_LDAP_SERVER, ipadiscovery.NOT_IPA_SERVER) \
|
||||||
|
or not ds.getDomainName():
|
||||||
logging.debug("Domain not found")
|
logging.debug("Domain not found")
|
||||||
if options.domain:
|
if options.domain:
|
||||||
cli_domain = options.domain
|
cli_domain = options.domain
|
||||||
@ -815,7 +816,8 @@ def install(options, env, fstore, statestore):
|
|||||||
cli_domain = ds.getDomainName()
|
cli_domain = ds.getDomainName()
|
||||||
logging.debug("will use domain: %s\n", cli_domain)
|
logging.debug("will use domain: %s\n", cli_domain)
|
||||||
|
|
||||||
if ret == ipadiscovery.NO_LDAP_SERVER or not ds.getServerName():
|
if ret in (ipadiscovery.NO_LDAP_SERVER, ipadiscovery.NOT_IPA_SERVER) \
|
||||||
|
or not ds.getServerName():
|
||||||
logging.debug("IPA Server not found")
|
logging.debug("IPA Server not found")
|
||||||
if options.server:
|
if options.server:
|
||||||
cli_server = options.server
|
cli_server = options.server
|
||||||
|
@ -220,7 +220,8 @@ class IPADiscovery:
|
|||||||
raise RuntimeError("Creating temporary directory failed: %s" % str(e))
|
raise RuntimeError("Creating temporary directory failed: %s" % str(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
run(["/usr/bin/wget", "-O", "%s/ca.crt" % temp_ca_dir, "http://%s/ipa/config/ca.crt" % format_netloc(thost)])
|
run(["/usr/bin/wget", "-O", "%s/ca.crt" % temp_ca_dir, "-T", "15", "-t", "2",
|
||||||
|
"http://%s/ipa/config/ca.crt" % format_netloc(thost)])
|
||||||
except CalledProcessError, e:
|
except CalledProcessError, e:
|
||||||
logging.debug('Retrieving CA from %s failed.\n%s' % (thost, str(e)))
|
logging.debug('Retrieving CA from %s failed.\n%s' % (thost, str(e)))
|
||||||
return [NOT_IPA_SERVER]
|
return [NOT_IPA_SERVER]
|
||||||
|
Loading…
Reference in New Issue
Block a user