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/lib/bb/ui/toasterui.py | |
parent | 4a711028c709d4bb1421e1637ae3fb0ac404fb45 (diff) | |
download | openembedded-core-contrib-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/lib/bb/ui/toasterui.py')
-rw-r--r-- | bitbake/lib/bb/ui/toasterui.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py index f0f853be14..6a7a1cd174 100644 --- a/bitbake/lib/bb/ui/toasterui.py +++ b/bitbake/lib/bb/ui/toasterui.py @@ -88,7 +88,7 @@ def main(server, eventHandler, params ): if not params.observe_only: logger.error("ToasterUI can only work in observer mode") - return + return 1 main.shutdown = 0 @@ -144,7 +144,6 @@ def main(server, eventHandler, params ): buildinfohelper.store_log_event(event) if event.levelno >= format.ERROR: errors = errors + 1 - return_value = 1 elif event.levelno == format.WARNING: warnings = warnings + 1 # For "normal" logging conditions, don't show note logs from tasks @@ -158,7 +157,6 @@ def main(server, eventHandler, params ): if isinstance(event, bb.build.TaskFailed): buildinfohelper.update_and_store_task(event) - return_value = 1 logfile = event.logfile if logfile and os.path.exists(logfile): bb.error("Logfile of failure stored in: %s" % logfile) @@ -188,7 +186,6 @@ def main(server, eventHandler, params ): continue if isinstance(event, bb.event.NoProvider): - return_value = 1 errors = errors + 1 if event._runtime: r = "R" @@ -316,6 +313,7 @@ def main(server, eventHandler, params ): continue logger.error("Unknown event: %s", event) + return_value += 1 except EnvironmentError as ioerror: # ignore interrupted io @@ -344,10 +342,13 @@ def main(server, eventHandler, params ): except Exception as ce: logger.error("CRITICAL - Failed to to save toaster exception to the database: %s" % str(ce)) + # make sure we return with an error + return_value += 1 pass if interrupted: if return_value == 0: - return_value = 1 + return_value += 1 + logger.warn("Return value is %d", return_value) return return_value |