aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-09 17:40:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-09 17:50:54 +0100
commit64ae9d7e2fad804dd9e12706c6d76b4b22f9586b (patch)
treee0550ed50bdfea190e3263667e61bb796e56b300
parentef762d92df6c2554c6248e80212f984d9ec4c651 (diff)
downloadbitbake-64ae9d7e2fad804dd9e12706c6d76b4b22f9586b.tar.gz
tinfoil: When sending commands we need to process events
The server may be displaying useful information for the user through log messages so we should display anything that has been sent. Its either this or expecting every UI to implement this code around every command call which isn't good API. [YOCTO #14054] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/tinfoil.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index 2fb1bb7d2..763c32981 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -461,7 +461,16 @@ class Tinfoil:
commandline = [command]
if params:
commandline.extend(params)
- result = self.server_connection.connection.runCommand(commandline)
+ try:
+ result = self.server_connection.connection.runCommand(commandline)
+ finally:
+ while True:
+ event = self.wait_event()
+ if not event:
+ break
+ if isinstance(event, logging.LogRecord):
+ if event.taskpid == 0 or event.levelno > logging.INFO:
+ self.logger.handle(event)
if result[1]:
raise TinfoilCommandFailed(result[1])
return result[0]