diff options
author | Sujith H <sujith.h@gmail.com> | 2016-04-06 17:46:34 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-06 23:10:29 +0100 |
commit | dfa85109d6022dce47983ef8e887448b4e3dc48f (patch) | |
tree | c9da1e3925b3a48b0e6f1e7591b3340eb7a88aab /bitbake/lib/toaster | |
parent | 5f862bb5674b9db54d07c87b9505ce23acae07cb (diff) | |
download | poky-dfa85109d6022dce47983ef8e887448b4e3dc48f.tar.gz |
bitbake: toaster: models Add cancelled state to build outcome
A new state CANCELLED is introduced to, distinguish
the state of build.
[YOCTO #6787]
(Bitbake rev: 404f406fecae879703bcfe96f3b65086b115fa8a)
Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r-- | bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py | 19 | ||||
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 7 |
2 files changed, 25 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py b/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py new file mode 100644 index 0000000000..91a32a9e00 --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py | |||
@@ -0,0 +1,19 @@ | |||
1 | # -*- coding: utf-8 -*- | ||
2 | from __future__ import unicode_literals | ||
3 | |||
4 | from django.db import migrations, models | ||
5 | |||
6 | |||
7 | class Migration(migrations.Migration): | ||
8 | |||
9 | dependencies = [ | ||
10 | ('orm', '0005_task_field_separation'), | ||
11 | ] | ||
12 | |||
13 | operations = [ | ||
14 | migrations.AlterField( | ||
15 | model_name='build', | ||
16 | name='outcome', | ||
17 | field=models.IntegerField(default=2, choices=[(0, b'Succeeded'), (1, b'Failed'), (2, b'In Progress'), (3, b'Cancelled')]), | ||
18 | ), | ||
19 | ] | ||
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index d3277efb1f..7598744a24 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -358,11 +358,13 @@ class Build(models.Model): | |||
358 | SUCCEEDED = 0 | 358 | SUCCEEDED = 0 |
359 | FAILED = 1 | 359 | FAILED = 1 |
360 | IN_PROGRESS = 2 | 360 | IN_PROGRESS = 2 |
361 | CANCELLED = 3 | ||
361 | 362 | ||
362 | BUILD_OUTCOME = ( | 363 | BUILD_OUTCOME = ( |
363 | (SUCCEEDED, 'Succeeded'), | 364 | (SUCCEEDED, 'Succeeded'), |
364 | (FAILED, 'Failed'), | 365 | (FAILED, 'Failed'), |
365 | (IN_PROGRESS, 'In Progress'), | 366 | (IN_PROGRESS, 'In Progress'), |
367 | (CANCELLED, 'Cancelled'), | ||
366 | ) | 368 | ) |
367 | 369 | ||
368 | search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"] | 370 | search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"] |
@@ -390,7 +392,10 @@ class Build(models.Model): | |||
390 | if project: | 392 | if project: |
391 | builds = builds.filter(project=project) | 393 | builds = builds.filter(project=project) |
392 | 394 | ||
393 | finished_criteria = Q(outcome=Build.SUCCEEDED) | Q(outcome=Build.FAILED) | 395 | finished_criteria = \ |
396 | Q(outcome=Build.SUCCEEDED) | \ | ||
397 | Q(outcome=Build.FAILED) | \ | ||
398 | Q(outcome=Build.CANCELLED) | ||
394 | 399 | ||
395 | recent_builds = list(itertools.chain( | 400 | recent_builds = list(itertools.chain( |
396 | builds.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"), | 401 | builds.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"), |