diff options
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py index dd8f84b07a..fa8c1a9906 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | |||
@@ -1,8 +1,8 @@ | |||
1 | from django.core.management.base import NoArgsCommand, CommandError | 1 | from django.core.management.base import NoArgsCommand, CommandError |
2 | from django.db import transaction | 2 | from django.db import transaction |
3 | from orm.models import Build | 3 | from orm.models import Build |
4 | from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException | 4 | from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException, BuildSetupException |
5 | from bldcontrol.models import BuildRequest, BuildEnvironment | 5 | from bldcontrol.models import BuildRequest, BuildEnvironment, BRError |
6 | import os | 6 | import os |
7 | 7 | ||
8 | class Command(NoArgsCommand): | 8 | class Command(NoArgsCommand): |
@@ -25,6 +25,7 @@ class Command(NoArgsCommand): | |||
25 | return br | 25 | return br |
26 | 26 | ||
27 | def schedule(self): | 27 | def schedule(self): |
28 | import traceback | ||
28 | try: | 29 | try: |
29 | br = None | 30 | br = None |
30 | try: | 31 | try: |
@@ -63,15 +64,19 @@ class Command(NoArgsCommand): | |||
63 | 64 | ||
64 | # cleanup to be performed by toaster when the deed is done | 65 | # cleanup to be performed by toaster when the deed is done |
65 | 66 | ||
66 | except ShellCmdException as e: | ||
67 | import traceback | ||
68 | print " EE Error executing shell command\n", e | ||
69 | traceback.format_exc(e) | ||
70 | 67 | ||
71 | except Exception as e: | 68 | except Exception as e: |
72 | import traceback | 69 | print " EE Error executing shell command\n", e |
73 | traceback.print_exc() | 70 | traceback.print_exc(e) |
74 | raise e | 71 | BRError.objects.create(req = br, |
72 | errtype = str(type(e)), | ||
73 | errmsg = str(e), | ||
74 | traceback = traceback.format_exc(e)) | ||
75 | br.state = BuildRequest.REQ_FAILED | ||
76 | br.save() | ||
77 | bec.be.lock = BuildEnvironment.LOCK_FREE | ||
78 | bec.be.save() | ||
79 | |||
75 | 80 | ||
76 | def cleanup(self): | 81 | def cleanup(self): |
77 | from django.utils import timezone | 82 | from django.utils import timezone |