mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
committed by
Rob Crittenden
parent
a071257ed2
commit
d0648f1fd4
@@ -235,6 +235,11 @@ class PortResponder(threading.Thread):
|
|||||||
self._stop_request = True
|
self._stop_request = True
|
||||||
|
|
||||||
def port_check(host, port_list):
|
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 = []
|
failed_ports = []
|
||||||
for port in port_list:
|
for port in port_list:
|
||||||
if ipautil.host_port_open(host, port.port, port.stream, CONNECT_TIMEOUT):
|
if ipautil.host_port_open(host, port.port, port.stream, CONNECT_TIMEOUT):
|
||||||
|
|||||||
Reference in New Issue
Block a user