[oe-commits] [bitbake] 02/06: toaster: buildinfohelper: Use correct way to get message from LogMessage
git at git.openembedded.org
git at git.openembedded.org
Thu Oct 6 10:44:06 UTC 2016
rpurdie pushed a commit to branch master
in repository bitbake.
commit 11b3b6a7087554d14a2812a9ae463dce740b879e
Author: Michael Wood <michael.g.wood at intel.com>
AuthorDate: Wed Oct 5 17:08:50 2016 -0700
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)
Signed-off-by: Michael Wood <michael.g.wood at intel.com>
Signed-off-by: bavery <brian.avery at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/ui/buildinfohelper.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index 970a941..5b69660 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/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)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list