From 354a5db38e46aaf7ff4ecb0b6ee54a18194c376e Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Wed, 13 Mar 2013 14:44:20 +0100 Subject: [PATCH] Avoid multiple client discovery with fixed server list In client discovery module, we used to run up to three discovery processes even though we received a fixed list of servers to connect to. This could result in up to 3 identical "not an IPA server" error messages when the passed server is not an IPA server. Error out immediately when we are discovering against a fixed set of servers. Related to fixes in https://fedorahosted.org/freeipa/ticket/3418 --- ipa-client/ipa-install/ipa-client-install | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index 97332d1a0..d9e1b7e78 100755 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -1738,6 +1738,17 @@ def install(options, env, fstore, statestore): ret = ds.search(domain=options.domain, servers=options.server, hostname=hostname, ca_cert_path=get_cert_path(options.ca_cert_file)) + if options.server and ret != 0: + # There is no point to continue with installation as server list was + # passed as a fixed list of server and thus we cannot discover any + # better result + root_logger.error("Failed to verify that %s is an IPA Server.", + ', '.join(options.server)) + root_logger.error("This may mean that the remote server is not up " + "or is not reachable due to network or firewall settings.") + print_port_conf_info() + return CLIENT_INSTALL_ERROR + if ret == ipadiscovery.BAD_HOST_CONFIG: root_logger.error("Can't get the fully qualified name of this host") root_logger.info("Check that the client is properly configured")