diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-01-14 12:35:12 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-27 21:01:03 +0000 |
commit | 731a0ac2c8ee7f09c24e30b01ac6e3aeaeb1fd08 (patch) | |
tree | 95e31f60da5a68d5c2032296ce4450f8c6d9f8db /bitbake/lib/toaster/orm | |
parent | 3e1dbed33822dd949336022bc155cc5435719b38 (diff) | |
download | poky-731a0ac2c8ee7f09c24e30b01ac6e3aeaeb1fd08.tar.gz |
bitbake: toaster: update Task classification fields
This patch updates the task classification fields (outcome, etc)
as to
* Changes outcome names from SSTATE to CACHED and
from EXISTING to PREBUILT
* NoExec tasks now recorded as Not Executed / script type NA instead
of Executed / script type NOEXEC. Script type NOEXEC is deleted.
* SetScene tasks do not get order numbers
* New task method that returns a QuerySet for setscene tasks related
to this task: Task.get_related_setscene()
* New custom TaskManager that allows searching for setscene tasks
related to a certain task: Task.objects.related_setscene(task)
(Bitbake rev: a4164821a142f8b625a5fdc209adc6dc80874241)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index ff26c7d436..7c439487e9 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -60,6 +60,11 @@ class Target(models.Model): | |||
60 | return self.target | 60 | return self.target |
61 | 61 | ||
62 | 62 | ||
63 | |||
64 | class TaskManager(models.Manager): | ||
65 | def related_setscene(self, task_object): | ||
66 | return Task.objects.filter(task_executed=True, build = task_object.build, recipe = task_object.recipe, task_name=task_object.task_name+"_setscene") | ||
67 | |||
63 | class Task(models.Model): | 68 | class Task(models.Model): |
64 | 69 | ||
65 | SSTATE_NA = 0 | 70 | SSTATE_NA = 0 |
@@ -75,38 +80,41 @@ class Task(models.Model): | |||
75 | ) | 80 | ) |
76 | 81 | ||
77 | CODING_NA = 0 | 82 | CODING_NA = 0 |
78 | CODING_NOEXEC = 1 | ||
79 | CODING_PYTHON = 2 | 83 | CODING_PYTHON = 2 |
80 | CODING_SHELL = 3 | 84 | CODING_SHELL = 3 |
81 | 85 | ||
82 | TASK_CODING = ( | 86 | TASK_CODING = ( |
83 | (CODING_NA, 'N/A'), | 87 | (CODING_NA, 'N/A'), |
84 | (CODING_NOEXEC, 'NoExec'), | ||
85 | (CODING_PYTHON, 'Python'), | 88 | (CODING_PYTHON, 'Python'), |
86 | (CODING_SHELL, 'Shell'), | 89 | (CODING_SHELL, 'Shell'), |
87 | ) | 90 | ) |
88 | 91 | ||
89 | OUTCOME_SUCCESS = 0 | 92 | OUTCOME_SUCCESS = 0 |
90 | OUTCOME_COVERED = 1 | 93 | OUTCOME_COVERED = 1 |
91 | OUTCOME_SSTATE = 2 | 94 | OUTCOME_CACHED = 2 |
92 | OUTCOME_EXISTING = 3 | 95 | OUTCOME_PREBUILT = 3 |
93 | OUTCOME_FAILED = 4 | 96 | OUTCOME_FAILED = 4 |
94 | OUTCOME_NA = 5 | 97 | OUTCOME_NA = 5 |
95 | 98 | ||
96 | TASK_OUTCOME = ( | 99 | TASK_OUTCOME = ( |
97 | (OUTCOME_SUCCESS, 'Succeeded'), | 100 | (OUTCOME_SUCCESS, 'Succeeded'), |
98 | (OUTCOME_COVERED, 'Covered'), | 101 | (OUTCOME_COVERED, 'Covered'), |
99 | (OUTCOME_SSTATE, 'Sstate'), | 102 | (OUTCOME_CACHED, 'Cached'), |
100 | (OUTCOME_EXISTING, 'Existing'), | 103 | (OUTCOME_PREBUILT, 'Prebuilt'), |
101 | (OUTCOME_FAILED, 'Failed'), | 104 | (OUTCOME_FAILED, 'Failed'), |
102 | (OUTCOME_NA, 'Not Available'), | 105 | (OUTCOME_NA, 'Not Available'), |
103 | ) | 106 | ) |
104 | 107 | ||
105 | search_allowed_fields = [ "recipe__name", "task_name" ] | 108 | search_allowed_fields = [ "recipe__name", "task_name" ] |
106 | 109 | ||
110 | objects = TaskManager() | ||
111 | |||
112 | def get_related_setscene(self): | ||
113 | return Task.objects.related_setscene(self) | ||
114 | |||
107 | build = models.ForeignKey(Build, related_name='task_build') | 115 | build = models.ForeignKey(Build, related_name='task_build') |
108 | order = models.IntegerField(null=True) | 116 | order = models.IntegerField(null=True) |
109 | task_executed = models.BooleanField(default=False) # True means Executed, False means Prebuilt | 117 | task_executed = models.BooleanField(default=False) # True means Executed, False means Not/Executed |
110 | outcome = models.IntegerField(choices=TASK_OUTCOME, default=OUTCOME_NA) | 118 | outcome = models.IntegerField(choices=TASK_OUTCOME, default=OUTCOME_NA) |
111 | sstate_checksum = models.CharField(max_length=100, blank=True) | 119 | sstate_checksum = models.CharField(max_length=100, blank=True) |
112 | path_to_sstate_obj = models.FilePathField(max_length=500, blank=True) | 120 | path_to_sstate_obj = models.FilePathField(max_length=500, blank=True) |