[gnome-continuous-yocto/gnomeostree-3.28-rocko: 2896/8267] bitbake: toaster: buildinfohelper: Use correct way to get message from LogMessage
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 2896/8267] bitbake: toaster: buildinfohelper: Use correct way to get message from LogMessage
- Date: Sat, 16 Dec 2017 23:52:23 +0000 (UTC)
commit 25ea0b625dd8dc8c5a19beb42d3aefce3501b3e2
Author: Michael Wood <michael g wood intel com>
Date: Wed Oct 5 17:08:50 2016 -0700
bitbake: toaster: buildinfohelper: Use correct way to get message from LogMessage
Use the correct method to get a message value from the LogMessage object
rather than constructing it ourselves which is not recommended. This
causes an exception when the msg contains a '%' such as when there are
wildcards in file names (something2.%.bbappends)
(Bitbake rev: 11b3b6a7087554d14a2812a9ae463dce740b879e)
Signed-off-by: Michael Wood <michael g wood intel com>
Signed-off-by: bavery <brian avery intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
bitbake/lib/bb/ui/buildinfohelper.py | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 970a941..5b69660 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -1565,16 +1565,12 @@ class BuildInfoHelper(object):
mockevent.lineno = -1
self.store_log_event(mockevent)
-
def store_log_event(self, event):
self._ensure_build()
if event.levelno < formatter.WARNING:
return
- if 'args' in vars(event):
- event.msg = event.msg % event.args
-
# early return for CLI builds
if self.brbe is None:
if not 'backlog' in self.internal_state:
@@ -1586,7 +1582,8 @@ class BuildInfoHelper(object):
# if we have a backlog of events, do our best to save them here
if len(self.internal_state['backlog']):
tempevent = self.internal_state['backlog'].pop()
- logger.debug(1, "buildinfohelper: Saving stored event %s " % tempevent)
+ logger.debug(1, "buildinfohelper: Saving stored event %s "
+ % tempevent)
self.store_log_event(tempevent)
else:
logger.info("buildinfohelper: All events saved")
@@ -1605,7 +1602,7 @@ class BuildInfoHelper(object):
else:
log_information['level'] = LogMessage.INFO
- log_information['message'] = event.msg
+ log_information['message'] = event.getMessage()
log_information['pathname'] = event.pathname
log_information['lineno'] = event.lineno
logger.info("Logging error 2: %s", log_information)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]