mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 12:28:44 +00:00
Merge pull request #224 from setrofim/master
ssh: fixing rasing of CalledProcessErrorWithStderr
This commit is contained in:
commit
b1ae5a5465
@ -85,6 +85,7 @@ class TimeoutError(Exception):
|
||||
class CalledProcessErrorWithStderr(CalledProcessError):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.output = kwargs.pop("output")
|
||||
self.error = kwargs.pop("error")
|
||||
super(CalledProcessErrorWithStderr, self).__init__(*args, **kwargs)
|
||||
|
||||
|
@ -245,7 +245,8 @@ class SshShell(object):
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise CalledProcessErrorWithStderr(e.returncode,
|
||||
e.cmd.replace(pass_string, ''),
|
||||
e.output, getattr(e, 'error', ''))
|
||||
output=e.output,
|
||||
error=getattr(e, 'error', ''))
|
||||
except TimeoutError as e:
|
||||
raise TimeoutError(e.command.replace(pass_string, ''), e.output)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user