diff options
Diffstat (limited to 'ipaserver/install/installutils.py')
-rw-r--r-- | ipaserver/install/installutils.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py index 31376177..b65958ed 100644 --- a/ipaserver/install/installutils.py +++ b/ipaserver/install/installutils.py @@ -414,58 +414,6 @@ def create_keytab(path, principal): kadmin("ktadd -k " + path + " " + principal) -def wait_for_open_ports(host, ports, timeout=0): - """ - Wait until the specified port(s) on the remote host are open. Timeout - in seconds may be specified to limit the wait. - """ - if not isinstance(ports, (tuple, list)): - ports = [ports] - - op_timeout = time.time() + timeout - ipv6_failover = False - - for port in ports: - while True: - try: - if ipv6_failover: - s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) - else: - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.connect((host, port)) - s.close() - break; - except socket.error, e: - if e.errno == 111: # 111: Connection refused - if timeout and time.time() > op_timeout: # timeout exceeded - raise e - time.sleep(1) - elif not ipv6_failover: # fallback to IPv6 connection - ipv6_failover = True - else: - raise e - -def wait_for_open_socket(socket_name, timeout=0): - """ - Wait until the specified socket on the local host is open. Timeout - in seconds may be specified to limit the wait. - """ - op_timeout = time.time() + timeout - - while True: - try: - s = socket.socket(socket.AF_UNIX) - s.connect(socket_name) - s.close() - break; - except socket.error, e: - if e.errno in (2,111): # 111: Connection refused, 2: File not found - if timeout and time.time() > op_timeout: # timeout exceeded - raise e - time.sleep(1) - else: - raise e - def resolve_host(host_name): try: addrinfos = socket.getaddrinfo(host_name, None, |