* [PATCH V1] framework/ssh_pexpect: add output buffered information when execute command exception
@ 2021-11-16 6:07 Dong, JunX
0 siblings, 0 replies; only message in thread
From: Dong, JunX @ 2021-11-16 6:07 UTC (permalink / raw)
To: dts; +Cc: PingX.Yu, weix.ling, junx.dong
From: "Dong, JunX" <junx.dong@intel.com>
Signed-off-by: Dong, JunX <junx.dong@intel.com>
---
framework/ssh_pexpect.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py
index 783f989..a9331d5 100644
--- a/framework/ssh_pexpect.py
+++ b/framework/ssh_pexpect.py
@@ -87,7 +87,7 @@ class SSHPexpect:
return before
def send_expect(self, command, expected, timeout=15, verify=False):
-
+ buffered_info = self.get_session_before(timeout=0)
try:
ret = self.send_expect_base(command, expected, timeout)
if verify:
@@ -96,11 +96,13 @@ class SSHPexpect:
return ret
else:
self.logger.error("Command: %s failure!" % command)
+ self.logger.error('Buffered info: ' + buffered_info)
self.logger.error(ret)
return int(ret_status)
else:
return ret
except Exception as e:
+ self.logger.error('Buffered info: ' + buffered_info)
print(RED("Exception happened in [%s] and output is [%s]" % (command, self.get_output_before())))
raise(e)
--
1.8.3.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-16 6:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 6:07 [PATCH V1] framework/ssh_pexpect: add output buffered information when execute command exception Dong, JunX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).