Don't use magic SlapPopen for promise

parent e3ee5379
...@@ -634,16 +634,19 @@ class Slapgrid(object): ...@@ -634,16 +634,19 @@ class Slapgrid(object):
promise = os.path.basename(command[0]) promise = os.path.basename(command[0])
self.logger.info("Checking promise %r.", promise) self.logger.info("Checking promise %r.", promise)
kw = dict(stdout=subprocess.PIPE, stderr=subprocess.PIPE) kw = dict(stdout=subprocess.PIPE, stderr=subprocess.PIPE,
stdin=subprocess.PIPE)
process_handler = SlapPopen(command, process_handler = subprocess.Popen(command,
preexec_fn=lambda: dropPrivileges(uid, gid), preexec_fn=lambda: dropPrivileges(uid, gid),
cwd=cwd, cwd=cwd,
env={}, **kw) env={}, **kw)
process_handler.stdin.flush()
process_handler.stdin.close()
process_handler.stdin = None
time.sleep(self.promise_timeout) time.sleep(self.promise_timeout)
if process_handler.poll() is None: if process_handler.poll() is None:
process_handler.terminate() process_handler.terminate()
raise Slapgrid.PromiseError("The promise %r timed out" % promise) raise Slapgrid.PromiseError("The promise %r timed out" % promise)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment