1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-07-15 03:23:47 +01:00

LinuxDevice: error output for pull/push_file

Standard string representation of a subprocess.CalledProcessError does
not include the output of the command, so it was not previsouly included
in the resulting DeviceError. This commit ensures that the output is
propagated, regardless of whether it came from stdout or stderr of the
underlying process.
This commit is contained in:
Sergei Trofimov
2016-06-23 11:50:19 +01:00
parent a6355885fc
commit 242df842bc
3 changed files with 11 additions and 4 deletions

@ -88,6 +88,12 @@ class CalledProcessErrorWithStderr(CalledProcessError):
self.error = kwargs.pop("error")
super(CalledProcessErrorWithStderr, self).__init__(*args, **kwargs)
def __str__(self):
return '{}\nSTDOUT: {}\nSTDERR:{}'.format(CalledProcessError.__str__(self),
self.output, self.error)
__repr__ = __str__
def check_output(command, timeout=None, ignore=None, **kwargs):
"""This is a version of subprocess.check_output that adds a timeout parameter to kill