Skip to content

Commit 0c38ad0

Browse files
committed
Show stderr of slapd -Ttest
Related: #370 Signed-off-by: Christian Heimes <cheimes@redhat.com>
1 parent 605a34b commit 0c38ad0

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Lib/slapdtest/_slapdtest.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,17 +392,19 @@ def _test_config(self):
392392
self._log.debug('testing config %s', self._slapd_conf)
393393
popen_list = [
394394
self.PATH_SLAPD,
395-
'-Ttest',
395+
"-Ttest",
396396
"-f", self._slapd_conf,
397-
'-u',
397+
"-u",
398+
"-v",
399+
"-d", "config"
398400
]
399-
if self._log.isEnabledFor(logging.DEBUG):
400-
popen_list.append('-v')
401-
popen_list.extend(['-d', 'config'])
402-
else:
403-
popen_list.append('-Q')
404-
proc = subprocess.Popen(popen_list)
405-
if proc.wait() != 0:
401+
p = subprocess.run(
402+
popen_list,
403+
stdout=subprocess.PIPE,
404+
stderr=subprocess.STDOUT
405+
)
406+
if p.returncode != 0:
407+
self._log.error(p.stdout.decode("utf-8"))
406408
raise RuntimeError("configuration test failed")
407409
self._log.info("config ok: %s", self._slapd_conf)
408410

0 commit comments

Comments
 (0)