]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/sshcontrol: Handle interrupted system call error
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 3 Oct 2016 14:56:13 +0000 (15:56 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Oct 2016 15:43:51 +0000 (16:43 +0100)
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>
meta/lib/oeqa/utils/sshcontrol.py

index da485ee408ad53d79c59c296fd14a2baa67355ee..05d65025508cf87ca41f19c8f7c7c71b2c3b3477 100644 (file)
@@ -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: