From cc69834192df4abc9345b123e165817a524266ba Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Jan 11 2012 17:04:22 +0000 Subject: Add DNS check to conncheck port probe It is pointless to report failures for all checked ports when the target hostname is not resolvable - user may get easily confused. This patch changes this behavior so that conncheck fails with a proper error and does not even continue to port probing part. https://fedorahosted.org/freeipa/ticket/1984 --- diff --git a/install/tools/ipa-replica-conncheck b/install/tools/ipa-replica-conncheck index 8f81636..882d77d 100755 --- a/install/tools/ipa-replica-conncheck +++ b/install/tools/ipa-replica-conncheck @@ -235,6 +235,11 @@ class PortResponder(threading.Thread): self._stop_request = True def port_check(host, port_list): + ip = installutils.resolve_host(host) + + if ip is None: + raise RuntimeError("Port check failed! Unable to resolve host name '%s'" % host) + failed_ports = [] for port in port_list: if ipautil.host_port_open(host, port.port, port.stream, CONNECT_TIMEOUT):