File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -392,17 +392,19 @@ def _test_config(self):
392
392
self ._log .debug ('testing config %s' , self ._slapd_conf )
393
393
popen_list = [
394
394
self .PATH_SLAPD ,
395
- ' -Ttest' ,
395
+ " -Ttest" ,
396
396
"-f" , self ._slapd_conf ,
397
- '-u' ,
397
+ "-u" ,
398
+ "-v" ,
399
+ "-d" , "config"
398
400
]
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" ))
406
408
raise RuntimeError ("configuration test failed" )
407
409
self ._log .info ("config ok: %s" , self ._slapd_conf )
408
410
You can’t perform that action at this time.
0 commit comments