summaryrefslogtreecommitdiffstats
path: root/lib/toaster/orm/models.py
diff options
context:
space:
mode:
authorSujith H <sujith.h@gmail.com>2016-04-06 17:46:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 23:00:10 +0100
commit404f406fecae879703bcfe96f3b65086b115fa8a (patch)
tree268375bf2d811ee5c8aa22858b54147995869404 /lib/toaster/orm/models.py
parente15151106aae21d3b164ca868be42bd63905f0a1 (diff)
downloadbitbake-404f406fecae879703bcfe96f3b65086b115fa8a.tar.gz
toaster: models Add cancelled state to build outcome
A new state CANCELLED is introduced to, distinguish the state of build. [YOCTO #6787] 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 'lib/toaster/orm/models.py')
-rw-r--r--lib/toaster/orm/models.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index d3277efb1..7598744a2 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -358,11 +358,13 @@ class Build(models.Model):
SUCCEEDED = 0
FAILED = 1
IN_PROGRESS = 2
+ CANCELLED = 3
BUILD_OUTCOME = (
(SUCCEEDED, 'Succeeded'),
(FAILED, 'Failed'),
(IN_PROGRESS, 'In Progress'),
+ (CANCELLED, 'Cancelled'),
)
search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"]
@@ -390,7 +392,10 @@ class Build(models.Model):
if project:
builds = builds.filter(project=project)
- finished_criteria = Q(outcome=Build.SUCCEEDED) | Q(outcome=Build.FAILED)
+ finished_criteria = \
+ Q(outcome=Build.SUCCEEDED) | \
+ Q(outcome=Build.FAILED) | \
+ Q(outcome=Build.CANCELLED)
recent_builds = list(itertools.chain(
builds.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"),