diff options
author | Elliot Smith <elliot.smith@intel.com> | 2015-10-15 15:45:13 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-16 14:13:22 +0100 |
commit | 93f0b61749155ba600f38dff5604a68da548c486 (patch) | |
tree | a38fc2e85a104f2b3b4b1665b0e5251563547c2d /bitbake/lib/toaster | |
parent | 069a611097265c0100582dfb69dfdddbc08a31fc (diff) | |
download | poky-93f0b61749155ba600f38dff5604a68da548c486.tar.gz |
bitbake: 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]
(Bitbake rev: b6eacbca9cacb607de864ab7d093deb296da8226)
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 'bitbake/lib/toaster')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 20 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/builddashboard.html | 11 |
2 files changed, 19 insertions, 12 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 44a453a58c..6ca45e0997 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -353,7 +353,9 @@ class Build(models.Model): | |||
353 | 353 | ||
354 | @property | 354 | @property |
355 | def errors(self): | 355 | def errors(self): |
356 | return (self.logmessage_set.filter(level=LogMessage.ERROR)|self.logmessage_set.filter(level=LogMessage.EXCEPTION)) | 356 | return (self.logmessage_set.filter(level=LogMessage.ERROR) | |
357 | self.logmessage_set.filter(level=LogMessage.EXCEPTION) | | ||
358 | self.logmessage_set.filter(level=LogMessage.CRITICAL)) | ||
357 | 359 | ||
358 | @property | 360 | @property |
359 | def warnings(self): | 361 | def warnings(self): |
@@ -1285,16 +1287,20 @@ class LogMessage(models.Model): | |||
1285 | INFO = 0 | 1287 | INFO = 0 |
1286 | WARNING = 1 | 1288 | WARNING = 1 |
1287 | ERROR = 2 | 1289 | ERROR = 2 |
1288 | 1290 | CRITICAL = 3 | |
1289 | LOG_LEVEL = ( (INFO, "info"), | 1291 | |
1290 | (WARNING, "warn"), | 1292 | LOG_LEVEL = ( |
1291 | (ERROR, "error"), | 1293 | (INFO, "info"), |
1292 | (EXCEPTION, "toaster exception")) | 1294 | (WARNING, "warn"), |
1295 | (ERROR, "error"), | ||
1296 | (CRITICAL, "critical"), | ||
1297 | (EXCEPTION, "toaster exception") | ||
1298 | ) | ||
1293 | 1299 | ||
1294 | build = models.ForeignKey(Build) | 1300 | build = models.ForeignKey(Build) |
1295 | task = models.ForeignKey(Task, blank = True, null=True) | 1301 | task = models.ForeignKey(Task, blank = True, null=True) |
1296 | level = models.IntegerField(choices=LOG_LEVEL, default=INFO) | 1302 | level = models.IntegerField(choices=LOG_LEVEL, default=INFO) |
1297 | message=models.CharField(max_length=240) | 1303 | message = models.CharField(max_length=240) |
1298 | pathname = models.FilePathField(max_length=255, blank=True) | 1304 | pathname = models.FilePathField(max_length=255, blank=True) |
1299 | lineno = models.IntegerField(null=True) | 1305 | lineno = models.IntegerField(null=True) |
1300 | 1306 | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html index aa991348b8..fc6cae6f29 100644 --- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html +++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html | |||
@@ -69,11 +69,12 @@ | |||
69 | <div class="accordion-body collapse in" id="collapse-errors"> | 69 | <div class="accordion-body collapse in" id="collapse-errors"> |
70 | <div class="accordion-inner"> | 70 | <div class="accordion-inner"> |
71 | <div class="span10"> | 71 | <div class="span10"> |
72 | {% for error in logmessages %}{% if error.level == 2 %} | 72 | {% for error in logmessages %} |
73 | <div class="alert alert-error"> | 73 | {% if error.level == 2 or error.level == 3 %} |
74 | <pre>{{error.message}}</pre> | 74 | <div class="alert alert-error"> |
75 | </div> | 75 | <pre>{{error.message}}</pre> |
76 | {% endif %} | 76 | </div> |
77 | {% endif %} | ||
77 | {% endfor %} | 78 | {% endfor %} |
78 | </div> | 79 | </div> |
79 | </div> | 80 | </div> |