Skip to content

Commit

Permalink
Show stderr of slapd -Ttest
Browse files Browse the repository at this point in the history
Related: #370
Signed-off-by: Christian Heimes <cheimes@redhat.com>
  • Loading branch information
Christian Heimes authored and Petr Viktorin committed Aug 7, 2020
1 parent 2e34d75 commit f881387
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Lib/slapdtest/_slapdtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,17 +392,19 @@ def _test_config(self):
self._log.debug('testing config %s', self._slapd_conf)
popen_list = [
self.PATH_SLAPD,
'-Ttest',
"-Ttest",
"-f", self._slapd_conf,
'-u',
"-u",
"-v",
"-d", "config"
]
if self._log.isEnabledFor(logging.DEBUG):
popen_list.append('-v')
popen_list.extend(['-d', 'config'])
else:
popen_list.append('-Q')
proc = subprocess.Popen(popen_list)
if proc.wait() != 0:
p = subprocess.run(
popen_list,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
if p.returncode != 0:
self._log.error(p.stdout.decode("utf-8"))
raise RuntimeError("configuration test failed")
self._log.info("config ok: %s", self._slapd_conf)

Expand Down

0 comments on commit f881387

Please sign in to comment.