diff options
| author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-11-05 14:47:51 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-12 17:04:48 +0000 |
| commit | 78e3a7877b361e9c3ae4865231d97a47bd8220bc (patch) | |
| tree | 1d8e76e4228ab6f17d2c198dd4f5df1d6f192326 /bitbake/lib/toaster/bldcontrol | |
| parent | 990fb9ed6cc8414e9a0b1baed8990261650af1db (diff) | |
| download | poky-78e3a7877b361e9c3ae4865231d97a47bd8220bc.tar.gz | |
bitbake: toaster: update Release model to pinpoint to specific Branch
We update the release model to pinpoint to specific branch,
instead of holding a branch name that needs to be matched.
This is needed because we move away from mixing branches on different
layer sources.
Various minor changes to models file.
(Bitbake rev: d58aacc69b1832f99758b941803123329e06082d)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol')
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py | 9 | ||||
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/models.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/tests.py | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py index 9b58587316..08eebceaab 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py | |||
| @@ -150,16 +150,15 @@ class Command(NoArgsCommand): | |||
| 150 | bvo = BitbakeVersion.objects.get(name = ri['bitbake']) | 150 | bvo = BitbakeVersion.objects.get(name = ri['bitbake']) |
| 151 | assert bvo is not None | 151 | assert bvo is not None |
| 152 | 152 | ||
| 153 | ro, created = Release.objects.get_or_create(name = ri['name'], bitbake_version = bvo) | 153 | ro, created = Release.objects.get_or_create(name = ri['name'], bitbake_version = bvo, branch = Branch.objects.get( layer_source__name = ri['layersource'], name=ri['branch'])) |
| 154 | ro.description = ri['description'] | 154 | ro.description = ri['description'] |
| 155 | ro.branch = ri['branch'] | 155 | ro.helptext = ri['helptext'] |
| 156 | ro.save() | 156 | ro.save() |
| 157 | 157 | ||
| 158 | for dli in ri['defaultlayers']: | 158 | for dli in ri['defaultlayers']: |
| 159 | lsi, layername = dli.split(":") | ||
| 160 | layer, created = Layer.objects.get_or_create( | 159 | layer, created = Layer.objects.get_or_create( |
| 161 | layer_source = LayerSource.objects.get(name = lsi), | 160 | layer_source = LayerSource.objects.get(name = ri['layersource']), |
| 162 | name = layername | 161 | name = dli |
| 163 | ) | 162 | ) |
| 164 | ReleaseDefaultLayer.objects.get_or_create( release = ro, layer = layer) | 163 | ReleaseDefaultLayer.objects.get_or_create( release = ro, layer = layer) |
| 165 | 164 | ||
diff --git a/bitbake/lib/toaster/bldcontrol/models.py b/bitbake/lib/toaster/bldcontrol/models.py index 15270c3a57..f72fb8fbc9 100644 --- a/bitbake/lib/toaster/bldcontrol/models.py +++ b/bitbake/lib/toaster/bldcontrol/models.py | |||
| @@ -62,6 +62,7 @@ class BuildRequest(models.Model): | |||
| 62 | REQ_INPROGRESS = 2 | 62 | REQ_INPROGRESS = 2 |
| 63 | REQ_COMPLETED = 3 | 63 | REQ_COMPLETED = 3 |
| 64 | REQ_FAILED = 4 | 64 | REQ_FAILED = 4 |
| 65 | REQ_DELETED = 5 | ||
| 65 | 66 | ||
| 66 | REQUEST_STATE = ( | 67 | REQUEST_STATE = ( |
| 67 | (REQ_CREATED, "created"), | 68 | (REQ_CREATED, "created"), |
| @@ -69,6 +70,7 @@ class BuildRequest(models.Model): | |||
| 69 | (REQ_INPROGRESS, "in progress"), | 70 | (REQ_INPROGRESS, "in progress"), |
| 70 | (REQ_COMPLETED, "completed"), | 71 | (REQ_COMPLETED, "completed"), |
| 71 | (REQ_FAILED, "failed"), | 72 | (REQ_FAILED, "failed"), |
| 73 | (REQ_DELETED, "deleted"), | ||
| 72 | ) | 74 | ) |
| 73 | 75 | ||
| 74 | project = models.ForeignKey(Project) | 76 | project = models.ForeignKey(Project) |
diff --git a/bitbake/lib/toaster/bldcontrol/tests.py b/bitbake/lib/toaster/bldcontrol/tests.py index 65e337a31b..37d6524c36 100644 --- a/bitbake/lib/toaster/bldcontrol/tests.py +++ b/bitbake/lib/toaster/bldcontrol/tests.py | |||
| @@ -130,7 +130,7 @@ class RunBuildsCommandTests(TestCase): | |||
| 130 | 130 | ||
| 131 | def test_br_select(self): | 131 | def test_br_select(self): |
| 132 | from orm.models import Project, Release, BitbakeVersion | 132 | from orm.models import Project, Release, BitbakeVersion |
| 133 | p = Project.objects.create_project("test", Release.objects.get_or_create(name = "HEAD", bitbake_version = BitbakeVersion.objects.get_or_create(name="HEAD", branch="HEAD")[0])[0]) | 133 | p = Project.objects.create_project("test", Release.objects.get_or_create(name = "HEAD", bitbake_version = BitbakeVersion.objects.get_or_create(name="HEAD", branch=Branch.objects.get_or_create(name="HEAD"))[0])[0]) |
| 134 | obr = BuildRequest.objects.create(state = BuildRequest.REQ_QUEUED, project = p) | 134 | obr = BuildRequest.objects.create(state = BuildRequest.REQ_QUEUED, project = p) |
| 135 | command = Command() | 135 | command = Command() |
| 136 | br = command._selectBuildRequest() | 136 | br = command._selectBuildRequest() |
