summaryrefslogtreecommitdiffstats
path: root/bin/toaster-eventreplay
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-05-01 16:20:33 +0100
committerAlexandru DAMIAN <alexandru.damian@intel.com>2015-05-01 17:37:37 +0100
commit1ddd6a9e4280a4adf971132ff1fe7ec9b3252905 (patch)
tree93596643a21dc906dc9adc2f6862ec363ce8dcf7 /bin/toaster-eventreplay
parentf8590547a198a78334debdf14bf40acb50c22ecc (diff)
downloadbitbake-contrib-1ddd6a9e4280a4adf971132ff1fe7ec9b3252905.tar.gz
bitbake-contrib-1ddd6a9e4280a4adf971132ff1fe7ec9b3252905.tar.bz2
bitbake-contrib-1ddd6a9e4280a4adf971132ff1fe7ec9b3252905.zip
toasterui: proper exit code on toaster errors
This patch modifies the toasterui to properly return the exit code based on the errors found in the toaster itself. The upload event file API call will not delete event logs for which toasterui showed an error. This will facilitate debugging. Minor enhancement in the buildinfohelper to reduce the number of lookups on unknown layer objects (prevented testing of the patch). Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Diffstat (limited to 'bin/toaster-eventreplay')
-rwxr-xr-xbin/toaster-eventreplay13
1 files changed, 4 insertions, 9 deletions
diff --git a/bin/toaster-eventreplay b/bin/toaster-eventreplay
index 624829aea0..615a7aed15 100755
--- a/bin/toaster-eventreplay
+++ b/bin/toaster-eventreplay
@@ -26,6 +26,7 @@
# as a build eventlog, and the ToasterUI is used to process events in the file
# and log data in the database
+from __future__ import print_function
import os
import sys, logging
@@ -39,12 +40,6 @@ from bb.ui import toasterui
import sys
import logging
-logger = logging.getLogger(__name__)
-console = logging.StreamHandler(sys.stdout)
-format_str = "%(levelname)s: %(message)s"
-logging.basicConfig(format=format_str)
-
-
import json, pickle
@@ -168,12 +163,12 @@ class MockConfigParameters():
# run toaster ui on our mock bitbake class
if __name__ == "__main__":
if len(sys.argv) < 2:
- logger.error("Usage: %s event.log " % sys.argv[0])
+ print("Usage: %s event.log " % sys.argv[0])
sys.exit(1)
file_name = sys.argv[-1]
mock_connection = FileReadEventsServerConnection(file_name)
configParams = MockConfigParameters()
- # run the main program
- toasterui.main(mock_connection.connection, mock_connection.events, configParams)
+ # run the main program and set exit code to the returned value
+ sys.exit(toasterui.main(mock_connection.connection, mock_connection.events, configParams))