Skip to contentSkip to conversation

oeqa/qemurunner: Dont mix binary and non-binary strings

PATCH New Richard Purdie 1 participant 1 message Mar 25, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/qemurunner: Dont mix binary and non-binary strings

self.msg is a str(), bootlog is b'' so this code clearly doesn't work. Add in a decode since its being used as a string.

---
 meta/lib/oeqa/utils/qemurunner.py | 1 +
 1 file changed, 1 insertion(+)
meta/lib/oeqa/utils/qemurunner.py +1 -0
index 7ef506b60a2..49020c1e636 100644
@@ -329,6 +329,7 @@ class QemuRunner:
                 self.logger.debug("Target didn't reach login banner in %d seconds (%s)" %
                                   (self.boottime, time.strftime("%D %H:%M:%S")))
             tail = lambda l: "\n".join(l.splitlines()[-25:])
+            bootlog = boolog.decode("utf-8")
             # in case bootlog is empty, use tail qemu log store at self.msg
             lines = tail(bootlog if bootlog else self.msg)
             self.logger.debug("Last 25 lines of text:\n%s" % lines)
Signature · 1 line
2.20.1