Skip to content

Commit f881387

Browse files
tiranencukou
authored andcommitted
Show stderr of slapd -Ttest
Related: python-ldap#370 Signed-off-by: Christian Heimes <cheimes@redhat.com>
1 parent 2e34d75 commit f881387

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)
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