summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-03 15:56:13 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-07 16:43:51 +0100
commit556125e4004fb7ac5169b59f51dc151f18c1806a (patch)
treeb174f8c112c85de2338da17e7860877cf6eb1e60
parent33df3a65f3e8e136811da715d0cc247ce66ae0ea (diff)
downloadopenembedded-core-contrib-556125e4004fb7ac5169b59f51dc151f18c1806a.tar.gz
openembedded-core-contrib-556125e4004fb7ac5169b59f51dc151f18c1806a.tar.bz2
openembedded-core-contrib-556125e4004fb7ac5169b59f51dc151f18c1806a.zip
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 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/utils/sshcontrol.py24
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):
endtime = self.starttime + timeout
eof = False
while time.time() < endtime and not eof:
- if select.select([self.process.stdout], [], [], 5)[0] != []:
- data = os.read(self.process.stdout.fileno(), 1024)
- if not data:
- self.process.stdout.close()
- eof = True
- else:
- data = data.decode("utf-8")
- output += data
- self.log(data)
- endtime = time.time() + timeout
-
+ try:
+ if select.select([self.process.stdout], [], [], 5)[0] != []:
+ data = os.read(self.process.stdout.fileno(), 1024)
+ if not data:
+ self.process.stdout.close()
+ eof = True
+ else:
+ data = data.decode("utf-8")
+ output += data
+ self.log(data)
+ endtime = time.time() + timeout
+ except InterruptedError:
+ continue
# process hasn't returned yet
if not eof: