Bug 11440

Summary: 'MockEvent' object has no attribute 'getMessage'
Product: [Build System, Metadata & Runtime] Toaster Reporter: David Reyna <david.reyna>
Component: toasterAssignee: David Reyna <david.reyna>
Status: RESOLVED FIXED QA Contact: Libertad <libertad.gonzalez.de.la.cruz>
Severity: normal    
Priority: Medium CC: jessica.zhang, stanciux.mihail
Version: 2.3   
Target Milestone: 2.4 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

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'