Skip to content

Commit 0829d52

Browse files
author
stroeder
committed
slapdtest.SlapdObject.restart() just restarts slapd without cleaning any data
1 parent e9aeb11 commit 0829d52

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

CHANGES

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Released 2.4.46 2017-11-xx
44
Changes since 2.4.45:
55

66
Lib/
7-
*
7+
* slapdtest.SlapdObject.restart() just restarts slapd
8+
without cleaning any data
89

910
Tests/
1011
*

Lib/slapdtest.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ def start(self):
285285
)
286286

287287
def stop(self):
288-
"""Stops the slapd server, and waits for it to terminate"""
288+
"""
289+
Stops the slapd server, and waits for it to terminate and cleans up
290+
"""
289291
if self._proc is not None:
290292
self._log.debug('stopping slapd with pid %d', self._proc.pid)
291293
self._proc.terminate()
@@ -294,11 +296,11 @@ def stop(self):
294296

295297
def restart(self):
296298
"""
297-
Restarts the slapd server; ERASING previous content.
298-
Starts the server even it if isn't already running.
299+
Restarts the slapd server with same data
299300
"""
300-
self.stop()
301-
self.start()
301+
self._proc.terminate()
302+
self.wait()
303+
self._start_slapd()
302304

303305
def wait(self):
304306
"""Waits for the slapd process to terminate by itself."""
@@ -309,7 +311,7 @@ def wait(self):
309311
def _stopped(self):
310312
"""Called when the slapd server is known to have terminated"""
311313
if self._proc is not None:
312-
self._log.info('slapd terminated')
314+
self._log.info('slapd[%d] terminated', self._proc.pid)
313315
self._proc = None
314316

315317
def _cli_auth_args(self):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy