1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 01:40:07 +00:00

bitbake: toaster: display Toaster exceptions and other fixes

Changing ToasterUI to log toaster exceptions on a different level than
build errors.

Updating the build dashboard to show Toaster exceptions.

We add extra logging to console for exceptions.

Fixed a problem where packages database entries were created instead of
being looked up in the database, conficting with entries created to
satisfy dependency information.

Toaster now checks for invalid states at startup and performs needed
cleanups.

Removed loading reference to jquery-ui.min.css as we do not have this
file.

(Bitbake rev: 2378812bc24d433125fb940f110154f0ce638448)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN
2014-11-25 10:12:46 +00:00
committed by Richard Purdie
parent 707a960ffa
commit af1f9fda8b
8 changed files with 77 additions and 8 deletions
+13 -2
View File
@@ -381,7 +381,7 @@ class ORMWrapper(object):
searchname = pkgpnmap[p]['OPKGN']
packagedict[p]['object'], created = Package.objects.get_or_create( build = build_obj, name = searchname )
if created or package[p]['object'].size == -1: # save the data anyway we can, not just if it was not created here; bug [YOCTO #6887]
if created or packagedict[p]['object'].size == -1: # save the data anyway we can, not just if it was not created here; bug [YOCTO #6887]
# fill in everything we can from the runtime-reverse package data
try:
packagedict[p]['object'].recipe = recipes[pkgpnmap[p]['PN']]
@@ -462,7 +462,7 @@ class ORMWrapper(object):
if 'OPKGN' in package_info.keys():
pname = package_info['OPKGN']
bp_object = Package.objects.create( build = build_obj,
bp_object, created = Package.objects.get_or_create( build = build_obj,
name = pname )
bp_object.installed_name = package_info['PKG']
@@ -1043,6 +1043,15 @@ class BuildInfoHelper(object):
mockevent.lineno = -1
self.store_log_event(mockevent)
def store_log_exception(self, text, backtrace = ""):
mockevent = MockEvent()
mockevent.levelno = -1
mockevent.msg = text
mockevent.pathname = backtrace
mockevent.lineno = -1
self.store_log_event(mockevent)
def store_log_event(self, event):
if event.levelno < format.WARNING:
return
@@ -1078,6 +1087,8 @@ class BuildInfoHelper(object):
log_information['level'] = LogMessage.ERROR
elif event.levelno == format.WARNING:
log_information['level'] = LogMessage.WARNING
elif event.levelno == -1: # toaster self-logging
log_information['level'] = -1
else:
log_information['level'] = LogMessage.INFO
+4 -3
View File
@@ -299,12 +299,13 @@ def main(server, eventHandler, params ):
logger.error(e)
import traceback
exception_data = traceback.format_exc()
print(exception_data)
# save them to database, if possible; if it fails, we already logged to console.
try:
buildinfohelper.store_log_error("%s\n%s" % (str(e), exception_data))
except Exception:
pass
buildinfohelper.store_log_exception("%s\n%s" % (str(e), exception_data))
except Exception as ce:
print("CRITICAL: failed to to save toaster exception to the database: %s" % str(ce))
pass