when stopping wait for real stopping of the daemon

This commit is contained in:
Benjamin Dauvergne 2016-04-26 00:27:23 +02:00
parent 048de86cdc
commit a7a316b6a3
1 changed files with 10 additions and 1 deletions

View File

@ -170,9 +170,18 @@ olcAccess: {{0}}to * by manage'''
assert self.process
process = self.process
self.process = None
process.kill()
while True:
try:
conn = self.get_connection()
conn.whoami_s()
except ldap.SERVER_DOWN:
break
else:
time.sleep(0.1)
self.process = None
def checkpoint(self):
'''Stop slapd and save current data state'''
assert not self.process