diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-05-01 16:20:33 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-08 17:42:05 +0100 |
commit | 7759cd4931b2e7af19eea79dfac6738a92687665 (patch) | |
tree | e09e11a14b04e02e9902b76505cf3f651d577edc /bitbake/bin | |
parent | 4a711028c709d4bb1421e1637ae3fb0ac404fb45 (diff) | |
download | poky-7759cd4931b2e7af19eea79dfac6738a92687665.tar.gz |
bitbake: 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).
(Bitbake rev: 1ddd6a9e4280a4adf971132ff1fe7ec9b3252905)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/toaster-eventreplay | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/bitbake/bin/toaster-eventreplay b/bitbake/bin/toaster-eventreplay index 624829aea0..615a7aed15 100755 --- a/bitbake/bin/toaster-eventreplay +++ b/bitbake/bin/toaster-eventreplay | |||
@@ -26,6 +26,7 @@ | |||
26 | # as a build eventlog, and the ToasterUI is used to process events in the file | 26 | # as a build eventlog, and the ToasterUI is used to process events in the file |
27 | # and log data in the database | 27 | # and log data in the database |
28 | 28 | ||
29 | from __future__ import print_function | ||
29 | import os | 30 | import os |
30 | import sys, logging | 31 | import sys, logging |
31 | 32 | ||
@@ -39,12 +40,6 @@ from bb.ui import toasterui | |||
39 | import sys | 40 | import sys |
40 | import logging | 41 | import logging |
41 | 42 | ||
42 | logger = logging.getLogger(__name__) | ||
43 | console = logging.StreamHandler(sys.stdout) | ||
44 | format_str = "%(levelname)s: %(message)s" | ||
45 | logging.basicConfig(format=format_str) | ||
46 | |||
47 | |||
48 | import json, pickle | 43 | import json, pickle |
49 | 44 | ||
50 | 45 | ||
@@ -168,12 +163,12 @@ class MockConfigParameters(): | |||
168 | # run toaster ui on our mock bitbake class | 163 | # run toaster ui on our mock bitbake class |
169 | if __name__ == "__main__": | 164 | if __name__ == "__main__": |
170 | if len(sys.argv) < 2: | 165 | if len(sys.argv) < 2: |
171 | logger.error("Usage: %s event.log " % sys.argv[0]) | 166 | print("Usage: %s event.log " % sys.argv[0]) |
172 | sys.exit(1) | 167 | sys.exit(1) |
173 | 168 | ||
174 | file_name = sys.argv[-1] | 169 | file_name = sys.argv[-1] |
175 | mock_connection = FileReadEventsServerConnection(file_name) | 170 | mock_connection = FileReadEventsServerConnection(file_name) |
176 | configParams = MockConfigParameters() | 171 | configParams = MockConfigParameters() |
177 | 172 | ||
178 | # run the main program | 173 | # run the main program and set exit code to the returned value |
179 | toasterui.main(mock_connection.connection, mock_connection.events, configParams) | 174 | sys.exit(toasterui.main(mock_connection.connection, mock_connection.events, configParams)) |