Bug 11440 - 'MockEvent' object has no attribute 'getMessage'
Summary: 'MockEvent' object has no attribute 'getMessage'
Status: RESOLVED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 2.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.4 M1
Assignee: David Reyna
QA Contact: Libertad
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-05-03 06:26 UTC by David Reyna
Modified: 2017-06-24 05:12 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Reyna 2017-05-03 06:26:40 UTC
Two log methods for "buildinfohelper" use a temporary "MockEvent" to call the method "store_log_event()". 

However, "store_log_event()" expects an event of the type "logging.LogRecord" which has an attribute 'getMessage' which "MockEvent" does not, leading to the error: 

ERROR: 'MockEvent' object has no attribute 'getMessage'
Traceback (most recent call last):
  File "/opt/dreyna/toaster_newer/poky/bitbake/lib/bb/ui/toasterui.py", line 346, in main
    buildinfohelper.store_log_error(text)
  File "/opt/dreyna/toaster_newer/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 1581, in store_log_error
    self.store_log_event(mockevent)
  File "/opt/dreyna/toaster_newer/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 1628, in store_log_event
    log_information['message'] = event.getMessage()
AttributeError: 'MockEvent' object has no attribute 'getMessage'