ffdc: Trigger Paramiko exec_command() timeout
Read stderr instead of stdout to trigger Paramiko exec_command() timout mechanism.
This fix timeing issue with previous patch.
Test:
- Regression test to openbmc, ubuntu, rhel with standard config and plugins
Signed-off-by: Peter D Phan <peterp@us.ibm.com>
Change-Id: I793ba98e638fcdf8214e491760d8a94af714a41a
diff --git a/ffdc/lib/ssh_utility.py b/ffdc/lib/ssh_utility.py
index ea5cf4f..1ca1b05 100644
--- a/ffdc/lib/ssh_utility.py
+++ b/ffdc/lib/ssh_utility.py
@@ -92,19 +92,19 @@
while time.time() < start + default_timeout:
# Need to do read/write operation to trigger
# paramiko exec_command timeout mechanism.
- xresults = stdout.readlines()
+ xresults = stderr.readlines()
results = ''.join(xresults)
+ time.sleep(1)
if stdout.channel.exit_status_ready():
break
- time.sleep(1)
cmd_exit_code = stdout.channel.recv_exit_status()
# Convert list of string to one string
err = ''
out = ''
- for item in stderr.readlines():
- err += item
for item in results:
+ err += item
+ for item in stdout.readlines():
out += item
return cmd_exit_code, err, out