From ae0294be445eb9cae7ab7f01242ed83170a9df0a Mon Sep 17 00:00:00 2001 From: Andrey Pavlov Date: Thu, 23 Jul 2015 19:56:11 +0300 Subject: [PATCH] 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 --- tempest_lib/common/ssh.py | 2 +- tempest_lib/exceptions.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tempest_lib/common/ssh.py b/tempest_lib/common/ssh.py index 6ee0daf..1911f9e 100644 --- a/tempest_lib/common/ssh.py +++ b/tempest_lib/common/ssh.py @@ -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): diff --git a/tempest_lib/exceptions.py b/tempest_lib/exceptions.py index ba51622..52df4d3 100644 --- a/tempest_lib/exceptions.py +++ b/tempest_lib/exceptions.py @@ -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")