提交 114a17b8 编写于 作者: L Lukáš Doktor 提交者: Amador Pahim

avocado.utils.process: Always log the command on Popen failure

The default exception of `subprocess.Popen` does not contain any useful
info. We already replace the original exception for "File not found"
exception, this patch always modifies the exception's message to include
the executed command.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 44a6efeb
......@@ -377,12 +377,8 @@ class SubProcess(object):
shell=self.shell,
env=self.env)
except OSError as details:
if details.errno == 2:
exc = OSError("File '%s' not found" % self.cmd.split()[0])
exc.errno = 2
raise exc
else:
raise
details.strerror += " (%s)" % self.cmd
raise details
self.start_time = time.time()
self.stdout_file = StringIO()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册