diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/utils/sshcontrol.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py index 8f98c45354..7de7c3eddd 100644 --- a/meta/lib/oeqa/utils/sshcontrol.py +++ b/meta/lib/oeqa/utils/sshcontrol.py | |||
@@ -13,7 +13,7 @@ import os | |||
13 | 13 | ||
14 | class SSHControl(object): | 14 | class SSHControl(object): |
15 | 15 | ||
16 | def __init__(self, host=None, timeout=200, logfile=None): | 16 | def __init__(self, host=None, timeout=300, logfile=None): |
17 | self.host = host | 17 | self.host = host |
18 | self.timeout = timeout | 18 | self.timeout = timeout |
19 | self._out = '' | 19 | self._out = '' |
@@ -52,9 +52,10 @@ class SSHControl(object): | |||
52 | self._ret = sshconn.poll() | 52 | self._ret = sshconn.poll() |
53 | else: | 53 | else: |
54 | if timeout is None: | 54 | if timeout is None: |
55 | endtime = time.time() + self.timeout | 55 | tdelta = self.timeout |
56 | else: | 56 | else: |
57 | endtime = time.time() + timeout | 57 | tdelta = timeout |
58 | endtime = time.time() + tdelta | ||
58 | while sshconn.poll() is None and time.time() < endtime: | 59 | while sshconn.poll() is None and time.time() < endtime: |
59 | time.sleep(1) | 60 | time.sleep(1) |
60 | # process hasn't returned yet | 61 | # process hasn't returned yet |
@@ -64,7 +65,8 @@ class SSHControl(object): | |||
64 | sshconn.kill() | 65 | sshconn.kill() |
65 | self._out = sshconn.stdout.read() | 66 | self._out = sshconn.stdout.read() |
66 | sshconn.stdout.close() | 67 | sshconn.stdout.close() |
67 | self.log("[!!! process killed]") | 68 | self._out += "\n[!!! SSH command timed out after %d seconds and it was killed]" % tdelta |
69 | self.log("[!!! SSH command timed out after %d seconds and it was killed]" % tdelta) | ||
68 | else: | 70 | else: |
69 | self._out = sshconn.stdout.read() | 71 | self._out = sshconn.stdout.read() |
70 | self._ret = sshconn.poll() | 72 | self._ret = sshconn.poll() |