File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments