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:
wlauto/utils
@ -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
|
||||
|
Reference in New Issue
Block a user