def get_output_nocheck(self, *cmd, **kwargs):
proc = self.create_subprocess(cmd,
stdout=subprocess.PIPE,
universal_newlines=True,
**kwargs)
# FIXME: support Python 2?
with proc:
stdout = proc.communicate()[0]
stdout = stdout.rstrip()
exitcode = proc.wait()
if exitcode:
cmd_str = ' '.join(map(shlex.quote, cmd))
self.logger.error("Command %s failed with exit code %s"
% (cmd_str, exitcode))
return (exitcode, stdout)
评论列表
文章目录