未验证 提交 109f504d 编写于 作者: A Amador Pahim

Merge branch 'harish-24-stdin_sub'

Signed-off-by: NAmador Pahim <apahim@redhat.com>
......@@ -531,6 +531,7 @@ class SubProcess(object):
else:
stderr = subprocess.PIPE
self._popen = subprocess.Popen(cmd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=stderr,
shell=self.shell,
......@@ -701,6 +702,16 @@ class SubProcess(object):
self._fill_results(rc)
return rc
def stdin_write(self, value, flush=False):
"""
Call the subprocess stdin.write() method for any input to subprocess
Optionally flush the input buffer
"""
self._init_subprocess()
self._popen.stdin.write(value)
if flush:
self._popen.stdin.flush()
def stop(self):
"""
Stop background subprocess.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册