summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-10-05 17:08:50 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-06 11:41:48 +0100
commit25ea0b625dd8dc8c5a19beb42d3aefce3501b3e2 (patch)
tree9ba71d9bd82f9a1934045b14eec619c5fe3d1deb
parentfffce32ebd8712e29cc6f9c4a7a97ce40f9916ee (diff)
downloadpoky-25ea0b625dd8dc8c5a19beb42d3aefce3501b3e2.tar.gz
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>
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 970a9415c1..5b69660a39 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -1565,16 +1565,12 @@ class BuildInfoHelper(object):
1565 mockevent.lineno = -1 1565 mockevent.lineno = -1
1566 self.store_log_event(mockevent) 1566 self.store_log_event(mockevent)
1567 1567
1568
1569 def store_log_event(self, event): 1568 def store_log_event(self, event):
1570 self._ensure_build() 1569 self._ensure_build()
1571 1570
1572 if event.levelno < formatter.WARNING: 1571 if event.levelno < formatter.WARNING:
1573 return 1572 return
1574 1573
1575 if 'args' in vars(event):
1576 event.msg = event.msg % event.args
1577
1578 # early return for CLI builds 1574 # early return for CLI builds
1579 if self.brbe is None: 1575 if self.brbe is None:
1580 if not 'backlog' in self.internal_state: 1576 if not 'backlog' in self.internal_state:
@@ -1586,7 +1582,8 @@ class BuildInfoHelper(object):
1586 # if we have a backlog of events, do our best to save them here 1582 # if we have a backlog of events, do our best to save them here
1587 if len(self.internal_state['backlog']): 1583 if len(self.internal_state['backlog']):
1588 tempevent = self.internal_state['backlog'].pop() 1584 tempevent = self.internal_state['backlog'].pop()
1589 logger.debug(1, "buildinfohelper: Saving stored event %s " % tempevent) 1585 logger.debug(1, "buildinfohelper: Saving stored event %s "
1586 % tempevent)
1590 self.store_log_event(tempevent) 1587 self.store_log_event(tempevent)
1591 else: 1588 else:
1592 logger.info("buildinfohelper: All events saved") 1589 logger.info("buildinfohelper: All events saved")
@@ -1605,7 +1602,7 @@ class BuildInfoHelper(object):
1605 else: 1602 else:
1606 log_information['level'] = LogMessage.INFO 1603 log_information['level'] = LogMessage.INFO
1607 1604
1608 log_information['message'] = event.msg 1605 log_information['message'] = event.getMessage()
1609 log_information['pathname'] = event.pathname 1606 log_information['pathname'] = event.pathname
1610 log_information['lineno'] = event.lineno 1607 log_information['lineno'] = event.lineno
1611 logger.info("Logging error 2: %s", log_information) 1608 logger.info("Logging error 2: %s", log_information)