summaryrefslogtreecommitdiffstats
path: root/lib/toaster/bldcontrol/management/commands/runbuilds.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-07-15 19:31:10 +0100
committerAlexandru DAMIAN <alexandru.damian@intel.com>2014-07-23 18:03:31 +0100
commit1868d5635b517e0fe1b874674ea7a78910b26e2e (patch)
tree84c7f4723ed5647742a4b57dc1911e993b665be5 /lib/toaster/bldcontrol/management/commands/runbuilds.py
parent4e438854120cbd10319df1b571ec93e334002325 (diff)
downloadbitbake-contrib-1868d5635b517e0fe1b874674ea7a78910b26e2e.tar.gz
toaster: properly set layers when running a build
This patch enables the localhost build controller to properly set the layers before the build runs. It creates the checkout directories under BuildEnvironment sourcedir directory, and runs the build in the buildir directory. Build launch errors are tracked in the newly added BRError table. These are different from build errors, in the sense that the build can't start due to these errors. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Diffstat (limited to 'lib/toaster/bldcontrol/management/commands/runbuilds.py')
-rw-r--r--lib/toaster/bldcontrol/management/commands/runbuilds.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/toaster/bldcontrol/management/commands/runbuilds.py b/lib/toaster/bldcontrol/management/commands/runbuilds.py
index dd8f84b07..fa8c1a990 100644
--- a/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -1,8 +1,8 @@
from django.core.management.base import NoArgsCommand, CommandError
from django.db import transaction
from orm.models import Build
-from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException
-from bldcontrol.models import BuildRequest, BuildEnvironment
+from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException, BuildSetupException
+from bldcontrol.models import BuildRequest, BuildEnvironment, BRError
import os
class Command(NoArgsCommand):
@@ -25,6 +25,7 @@ class Command(NoArgsCommand):
return br
def schedule(self):
+ import traceback
try:
br = None
try:
@@ -63,15 +64,19 @@ class Command(NoArgsCommand):
# cleanup to be performed by toaster when the deed is done
- except ShellCmdException as e:
- import traceback
- print " EE Error executing shell command\n", e
- traceback.format_exc(e)
except Exception as e:
- import traceback
- traceback.print_exc()
- raise e
+ print " EE Error executing shell command\n", e
+ traceback.print_exc(e)
+ BRError.objects.create(req = br,
+ errtype = str(type(e)),
+ errmsg = str(e),
+ traceback = traceback.format_exc(e))
+ br.state = BuildRequest.REQ_FAILED
+ br.save()
+ bec.be.lock = BuildEnvironment.LOCK_FREE
+ bec.be.save()
+
def cleanup(self):
from django.utils import timezone