diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-03 15:56:13 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-07 16:43:58 +0100 |
commit | 78c01995e34b8e044913c4ab8646932c00fd6560 (patch) | |
tree | ad943404dc7001bd396723f558ed7af8adf0297a /meta/lib/oeqa/utils/sshcontrol.py | |
parent | 3c1faa13cf8c6f1e90d0d9039337c8f09d21d77e (diff) | |
download | poky-78c01995e34b8e044913c4ab8646932c00fd6560.tar.gz |
oeqa/sshcontrol: Handle interrupted system call error
Deal with an interrupted system call gracefully:
| File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-systemd/build/meta/lib/oeqa/utils/sshcontrol.py", line 55, in _run
| if select.select([self.process.stdout], [], [], 5)[0] != []:
| InterruptedError: [Errno 4] Interrupted system call
(From OE-Core rev: 556125e4004fb7ac5169b59f51dc151f18c1806a)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/sshcontrol.py')
-rw-r--r-- | meta/lib/oeqa/utils/sshcontrol.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py index da485ee408..05d6502550 100644 --- a/meta/lib/oeqa/utils/sshcontrol.py +++ b/meta/lib/oeqa/utils/sshcontrol.py | |||
@@ -52,17 +52,19 @@ class SSHProcess(object): | |||
52 | endtime = self.starttime + timeout | 52 | endtime = self.starttime + timeout |
53 | eof = False | 53 | eof = False |
54 | while time.time() < endtime and not eof: | 54 | while time.time() < endtime and not eof: |
55 | if select.select([self.process.stdout], [], [], 5)[0] != []: | 55 | try: |
56 | data = os.read(self.process.stdout.fileno(), 1024) | 56 | if select.select([self.process.stdout], [], [], 5)[0] != []: |
57 | if not data: | 57 | data = os.read(self.process.stdout.fileno(), 1024) |
58 | self.process.stdout.close() | 58 | if not data: |
59 | eof = True | 59 | self.process.stdout.close() |
60 | else: | 60 | eof = True |
61 | data = data.decode("utf-8") | 61 | else: |
62 | output += data | 62 | data = data.decode("utf-8") |
63 | self.log(data) | 63 | output += data |
64 | endtime = time.time() + timeout | 64 | self.log(data) |
65 | 65 | endtime = time.time() + timeout | |
66 | except InterruptedError: | ||
67 | continue | ||
66 | 68 | ||
67 | # process hasn't returned yet | 69 | # process hasn't returned yet |
68 | if not eof: | 70 | if not eof: |