Add std out to ssh exception.

Some commands in case of error redirect his output in stdout
instead of stderr. I suggest to combine stdout and stderr and pass
this string to ssh exception. It will help to understand better
errors in ssh tests.

Change-Id: Ied28043f0eaefa1c3a00b7e98e52b13a86873827
This commit is contained in:
Andrey Pavlov 2015-07-23 19:56:11 +03:00
parent 672760e1b7
commit ae0294be44
2 changed files with 3 additions and 2 deletions

View File

@ -143,7 +143,7 @@ class Client(object):
if 0 != exit_status:
raise exceptions.SSHExecCommandFailed(
command=cmd, exit_status=exit_status,
strerror=''.join(err_data))
stderr=err_data, stdout=out_data)
return ''.join(out_data)
def test_connection_auth(self):

View File

@ -184,4 +184,5 @@ class SSHTimeout(TempestException):
class SSHExecCommandFailed(TempestException):
"""Raised when remotely executed command returns nonzero status."""
message = ("Command '%(command)s', exit status: %(exit_status)d, "
"Error:\n%(strerror)s")
"stderr:\n%(stderr)s\n"
"stdout:\n%(stdout)s")