summaryrefslogtreecommitdiffstats
path: root/lib/toaster/orm/models.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-10-15 15:45:13 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-16 14:06:45 +0100
commitb6eacbca9cacb607de864ab7d093deb296da8226 (patch)
tree05b24619a49872813c0e9c59f8fea2ee27e4f908 /lib/toaster/orm/models.py
parent8795667d03bd8705d7e13c5d3d6bb6da371fa91d (diff)
downloadbitbake-b6eacbca9cacb607de864ab7d093deb296da8226.tar.gz
toaster: Record critical errors
Critical errors (where a build failed for reasons of misconfiguration, such as a machine being specified which is not in a project's layers) were being ignored (only log records up to ERROR level were being logged to Toaster's db). This meant that the build would fail but would not correctly report why. Add support for CRITICAL error levels to the LogMessage model, include errors at this level in the errors property for a build, and show errors at this level in the build dashboard. [YOCTO #8320] Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/orm/models.py')
-rw-r--r--lib/toaster/orm/models.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 44a453a58..6ca45e099 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -353,7 +353,9 @@ class Build(models.Model):
@property
def errors(self):
- return (self.logmessage_set.filter(level=LogMessage.ERROR)|self.logmessage_set.filter(level=LogMessage.EXCEPTION))
+ return (self.logmessage_set.filter(level=LogMessage.ERROR) |
+ self.logmessage_set.filter(level=LogMessage.EXCEPTION) |
+ self.logmessage_set.filter(level=LogMessage.CRITICAL))
@property
def warnings(self):
@@ -1285,16 +1287,20 @@ class LogMessage(models.Model):
INFO = 0
WARNING = 1
ERROR = 2
-
- LOG_LEVEL = ( (INFO, "info"),
- (WARNING, "warn"),
- (ERROR, "error"),
- (EXCEPTION, "toaster exception"))
+ CRITICAL = 3
+
+ LOG_LEVEL = (
+ (INFO, "info"),
+ (WARNING, "warn"),
+ (ERROR, "error"),
+ (CRITICAL, "critical"),
+ (EXCEPTION, "toaster exception")
+ )
build = models.ForeignKey(Build)
task = models.ForeignKey(Task, blank = True, null=True)
level = models.IntegerField(choices=LOG_LEVEL, default=INFO)
- message=models.CharField(max_length=240)
+ message = models.CharField(max_length=240)
pathname = models.FilePathField(max_length=255, blank=True)
lineno = models.IntegerField(null=True)