diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-10-09 17:40:44 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2021-11-22 04:14:48 -1000 |
commit | f20da5247dea524e837c5b6fdeccc79cbafedf90 (patch) | |
tree | 0ebe67808b58ac762df1685601f66048e169b6f2 /lib/bb/tinfoil.py | |
parent | 80348b68a34b7ec45a0496a4af7f2ae0c26488f0 (diff) | |
download | bitbake-f20da5247dea524e837c5b6fdeccc79cbafedf90.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>
(cherry picked from commit 64ae9d7e2fad804dd9e12706c6d76b4b22f9586b)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'lib/bb/tinfoil.py')
-rw-r--r-- | lib/bb/tinfoil.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py index 8c9b6b8ca..ae6903895 100644 --- a/lib/bb/tinfoil.py +++ b/lib/bb/tinfoil.py @@ -465,7 +465,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] |