]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/qemurunner: Fix binary vs str issue
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 May 2021 17:12:15 +0000 (18:12 +0100)
committerAnuj Mittal <anuj.mittal@intel.com>
Tue, 11 May 2021 05:12:36 +0000 (13:12 +0800)
The recent logging changes for qemurunner showed up as errors on the
autobuilder where decode couldn't be called on the returned string.
Since the code returns binary data, return b'' instead of '' to match
to avoid tracebacks.

One of these cases was newly added, copied from the other which has
been there for a long time, always broken.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b8995b27db265b0a0b2d2ca595915f70f9f96e07)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/lib/oeqa/utils/qemurunner.py

index 84f7c5e76d5f1268059dc83c7c6af2b9aed82696..526b493669c3c536198cbb56106b88dfb1f66167 100644 (file)
@@ -650,7 +650,7 @@ class LoggingThread(threading.Thread):
             data = self.readsock.recv(count)
         except socket.error as e:
             if e.errno == errno.EAGAIN or e.errno == errno.EWOULDBLOCK:
-                return ''
+                return b''
             else:
                 raise
 
@@ -663,7 +663,7 @@ class LoggingThread(threading.Thread):
             # until qemu exits.
             if not self.canexit:
                 raise Exception("Console connection closed unexpectedly")
-            return ''
+            return b''
 
         return data