diff options
author | Matus Fabian <matfabia@cisco.com> | 2016-03-15 12:28:09 +0100 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2016-03-18 18:23:40 +0000 |
commit | 2d54ff480b3f135ef4be951c065b4a6d19a138f8 (patch) | |
tree | f9ad25efce733f408af0cc844db9428d5ed7947d | |
parent | d637af34421fffe61417bb16e45a7105aae118b9 (diff) |
Fixed SSH exec_command timeout
Change-Id: I8cd2fcfbe774bd651ed57be0129c32d6ba68adcc
Signed-off-by: Matus Fabian <matfabia@cisco.com>
-rw-r--r-- | resources/libraries/python/ssh.py | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/resources/libraries/python/ssh.py b/resources/libraries/python/ssh.py index e1215191af..ad5fb27b85 100644 --- a/resources/libraries/python/ssh.py +++ b/resources/libraries/python/ssh.py @@ -18,7 +18,6 @@ from time import time from robot.api import logger from interruptingcow import timeout from robot.utils.asserts import assert_equal, assert_not_equal -from socket import timeout as socket_timeout __all__ = ["exec_cmd", "exec_cmd_no_error"] @@ -86,24 +85,16 @@ class SSH(object): stdout = "" while True: - try: - buf = chan.recv(self.__MAX_RECV_BUF) - stdout += buf - if not buf: - break - except socket_timeout: - logger.trace('Channels stdout timeout occurred') + buf = chan.recv(self.__MAX_RECV_BUF) + stdout += buf + if not buf: break stderr = "" while True: - try: - buf = chan.recv_stderr(self.__MAX_RECV_BUF) - stderr += buf - if not buf: - break - except socket_timeout: - logger.trace('Channels stderr timeout occurred') + buf = chan.recv_stderr(self.__MAX_RECV_BUF) + stderr += buf + if not buf: break return_code = chan.recv_exit_status() |