summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2013-09-17 08:19:47 -0700
committerNadezhda Ivanova <nivanova@samba.org>2013-09-18 07:43:09 +0200
commitff886940272354743cd6eb50717891454d8e5500 (patch)
tree2fc244490fe1db05e6582d50a06069394eac8aa2
parent68a4081dd47344651cb4dfdf57247ce8e893a96e (diff)
downloadsamba-ff886940272354743cd6eb50717891454d8e5500.tar.gz
samba-ff886940272354743cd6eb50717891454d8e5500.tar.bz2
samba-ff886940272354743cd6eb50717891454d8e5500.zip
Give slapd a second to startup
Moving the sleep to the beginning of the loop avoids most occurrences of the "connection failed" message Signed-off-by: Howard Chu <hyc@symas.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@symas.com> Autobuild-User(master): Nadezhda Ivanova <nivanova@samba.org> Autobuild-Date(master): Wed Sep 18 07:43:09 CEST 2013 on sn-devel-104
-rw-r--r--python/samba/provision/backend.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/samba/provision/backend.py b/python/samba/provision/backend.py
index 58aab9829f..24d8675258 100644
--- a/python/samba/provision/backend.py
+++ b/python/samba/provision/backend.py
@@ -292,6 +292,7 @@ class LDAPBackend(ProvisionBackend):
while self.slapd.poll() is None:
# Wait until the socket appears
try:
+ time.sleep(1)
ldapi_db = Ldb(self.ldap_uri, lp=self.lp, credentials=self.credentials)
ldapi_db.search(base="", scope=SCOPE_BASE,
expression="(objectClass=OpenLDAProotDSE)")
@@ -299,7 +300,6 @@ class LDAPBackend(ProvisionBackend):
# the LDAP server!
return
except LdbError:
- time.sleep(1)
count = count + 1
if count > 15: