misc: do not use create_process() for slapadd

This commit is contained in:
Benjamin Dauvergne 2020-04-25 09:27:58 +02:00
parent a76ad19afe
commit 72c488b4c7
1 changed files with 4 additions and 1 deletions

View File

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