misc: do not use create_process() for slapadd
This commit is contained in:
parent
a76ad19afe
commit
72c488b4c7
|
@ -185,7 +185,10 @@ olcAccess: {{0}}to * by * manage
|
|||
|
||||
if context:
|
||||
ldif = ldif.format(**context)
|
||||
slapadd = self.create_process([SLAPADD_PATH, '-v', '-n%d' % db, '-F', self.config_dir])
|
||||
slapadd = subprocess.Popen(
|
||||
[SLAPADD_PATH, '-v', '-n%d' % db, '-F', self.config_dir],
|
||||
stdin=subprocess.PIPE, env=os.environ,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout, stderr = slapadd.communicate(input=bytearray(ldif, 'utf-8'))
|
||||
assert slapadd.returncode == 0, 'slapadd failed: %s' % stderr
|
||||
|
||||
|
|
Loading…
Reference in New Issue