summaryrefslogtreecommitdiffstats
path: root/ipaserver/ipaldap.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2012-05-24 11:23:36 -0400
committerRob Crittenden <rcritten@redhat.com>2012-07-02 17:08:58 -0400
commite5b6260008a3a7132fdaef99d800406eb8872316 (patch)
tree9981186bd06f5574570f5743cba05cd0aa9ee963 /ipaserver/ipaldap.py
parent6fb802152add24aa1842f4adccf59b23850ab336 (diff)
downloadfreeipa.git-e5b6260008a3a7132fdaef99d800406eb8872316.tar.gz
freeipa.git-e5b6260008a3a7132fdaef99d800406eb8872316.tar.xz
freeipa.git-e5b6260008a3a7132fdaef99d800406eb8872316.zip
Centralize timeout for waiting for servers to start.
All service start/restart currently go through ipapython/platform so move the "wait for service to start" code there as well. A dictionary of known services and ports to wait on is defined in base.py This is referenced by the platforms by instance name to determine what to wait for. For the case of dirsrv if we get that as a plain name (no specific instance) it is assumed to be the main IPA service. https://fedorahosted.org/freeipa/ticket/2375 https://fedorahosted.org/freeipa/ticket/2610
Diffstat (limited to 'ipaserver/ipaldap.py')
-rw-r--r--ipaserver/ipaldap.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py
index 8b5451c7..e4fa2c64 100644
--- a/ipaserver/ipaldap.py
+++ b/ipaserver/ipaldap.py
@@ -36,10 +36,9 @@ from ldap.controls import LDAPControl
from ldap.ldapobject import SimpleLDAPObject
from ipapython import ipautil
from ipalib import errors
-from ipapython.ipautil import format_netloc
+from ipapython.ipautil import format_netloc, wait_for_open_socket, wait_for_open_ports
from ipapython.entity import Entity
from ipaserver.plugins.ldap2 import IPASimpleLDAPObject
-from ipaserver.install import installutils
# Global variable to define SASL auth
SASL_AUTH = ldap.sasl.sasl({},'GSSAPI')
@@ -337,10 +336,10 @@ class IPAdmin(IPAEntryLDAPObject):
def __wait_for_connection(self, timeout):
lurl = ldapurl.LDAPUrl(self._uri)
if lurl.urlscheme == 'ldapi':
- installutils.wait_for_open_socket(lurl.hostport, timeout)
+ wait_for_open_socket(lurl.hostport, timeout)
else:
(host,port) = lurl.hostport.split(':')
- installutils.wait_for_open_ports(host, int(port), timeout)
+ wait_for_open_ports(host, int(port), timeout)
def __bind_with_wait(self, bind_func, timeout, *args, **kwargs):
try: