summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/migrations
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-04-06 17:46:35 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 23:10:29 +0100
commit9dcb9cb2ccf52fa846ce1462e01f045253959328 (patch)
treed8662a7bbd25f8b9dc7e8e14d54f479b838a0d27 /bitbake/lib/toaster/bldcontrol/migrations
parentdfa85109d6022dce47983ef8e887448b4e3dc48f (diff)
downloadpoky-9dcb9cb2ccf52fa846ce1462e01f045253959328.tar.gz
bitbake: toaster: bldcontrol models Add a cancelling state the BuildRequest
To accurately reflect the state of a build request we also need a cancelling state. This is set when we've started a build and then for whatever reason cancel it, cancelling is not instantaneous so we have this state to indicate that a cancel is in progress. Also add a state transition guard. As the state of a BuildRequest can currently be modified by three processes; Toastergui, Runbuilds/bldcontrol and the buildinofhelper we cannot say for sure which process will be running at the time of cancellation so in order to avoid one of these processes making an incorrect transition only allow transitions of state to increase. e.g. CREATED -> QUEUED -> INPROGRESS And to ignore such requested changes such as INPROGRESS -> CREATED (Bitbake rev: 449598c8e6be75bd0c9d59e7bdf859d1d6f83858) 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/bldcontrol/migrations')
-rw-r--r--bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py b/bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py
new file mode 100644
index 0000000000..eec9216ca3
--- /dev/null
+++ b/bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py
@@ -0,0 +1,19 @@
1# -*- coding: utf-8 -*-
2from __future__ import unicode_literals
3
4from django.db import migrations, models
5
6
7class Migration(migrations.Migration):
8
9 dependencies = [
10 ('bldcontrol', '0002_auto_20160120_1250'),
11 ]
12
13 operations = [
14 migrations.AlterField(
15 model_name='buildrequest',
16 name='state',
17 field=models.IntegerField(default=0, choices=[(0, b'created'), (1, b'queued'), (2, b'in progress'), (3, b'completed'), (4, b'failed'), (5, b'deleted'), (6, b'cancelling'), (7, b'archive')]),
18 ),
19 ]