toaster: add getMessage to MockEvent

Submitted by Reyna, David on May 10, 2017, 6:54 a.m. | Patch ID: 139707

Details

Message ID 1494399262-4653-1-git-send-email-david.reyna@windriver.com
State New
Headers show

Commit Message

Reyna, David May 10, 2017, 6:54 a.m.
From: David Reyna <David.Reyna@windriver.com>

The MockEvent needs to not only stand in for Toaster and Bitbake quick events,
it also needs to stand in for LogRecord, and for that it needs to provide
the new getMessage method.

[YOCTO #11440]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
 bitbake/lib/bb/ui/buildinfohelper.py | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 46be5a5..12caef9 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -858,6 +858,12 @@  class MockEvent(object):
         self.pathname = None
         self.lineno = None
 
+    def getMessage(self):
+        """
+        Simulate LogRecord message return
+        """
+        return self.msg
+
 
 class BuildInfoHelper(object):
     """ This class gathers the build information from the server and sends it