[oe-commits] [bitbake] 24/45: toaster: models Add cancelled state to build outcome

git at git.openembedded.org git at git.openembedded.org
Wed Apr 6 22:11:42 UTC 2016


rpurdie pushed a commit to branch master
in repository bitbake.

commit 404f406fecae879703bcfe96f3b65086b115fa8a
Author: Sujith H <sujith.h at gmail.com>
AuthorDate: Wed Apr 6 17:46:34 2016 +0100

    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 at gmail.com>
    Signed-off-by: Michael Wood <michael.g.wood at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 .../orm/migrations/0006_add_cancelled_state.py        | 19 +++++++++++++++++++
 lib/toaster/orm/models.py                             |  7 ++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/lib/toaster/orm/migrations/0006_add_cancelled_state.py b/lib/toaster/orm/migrations/0006_add_cancelled_state.py
new file mode 100644
index 0000000..91a32a9
--- /dev/null
+++ b/lib/toaster/orm/migrations/0006_add_cancelled_state.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('orm', '0005_task_field_separation'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='build',
+            name='outcome',
+            field=models.IntegerField(default=2, choices=[(0, b'Succeeded'), (1, b'Failed'), (2, b'In Progress'), (3, b'Cancelled')]),
+        ),
+    ]
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index d3277ef..7598744 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"),

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list