File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
See http://www.python-ldap.org/ for details.
5
5
6
- \$Id: slapdtest.py,v 1.1 2017/04/26 16:52:50 stroeder Exp $
6
+ \$Id: slapdtest.py,v 1.2 2017/04/26 20:46:37 stroeder Exp $
7
7
8
8
Python compability note:
9
9
This module only works with Python 2.7.x since
10
10
"""
11
11
12
+ __version__ = '2.4.37'
13
+
12
14
import os
13
15
import socket
14
16
import time
@@ -106,6 +108,9 @@ class SlapdObject(object):
106
108
PATH_SLAPD = os .path .join (SBINDIR , 'slapd' )
107
109
PATH_SLAPTEST = os .path .join (SBINDIR , 'slaptest' )
108
110
111
+ # time in secs to wait before trying to access slapd via LDAP (again)
112
+ _start_sleep = 1.5
113
+
109
114
def __init__ (self ):
110
115
self ._proc = None
111
116
self ._port = find_available_tcp_port (LOCALHOST )
@@ -183,11 +188,12 @@ def _wait_for_slapd(self):
183
188
if self ._proc .poll () is not None :
184
189
self ._stopped ()
185
190
raise RuntimeError ("slapd exited before opening port" )
191
+ time .sleep (self ._start_sleep )
186
192
try :
187
193
self ._log .debug ("Connecting to %s" , self .ldap_uri )
188
194
self .ldapwhoami ()
189
195
except RuntimeError :
190
- time . sleep ( 1 )
196
+ pass
191
197
else :
192
198
return
193
199
You can’t perform that action at this time.
0 commit comments