diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-09-16 17:22:33 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-21 21:58:06 +0100 |
| commit | 5e88c4a6fe8a295c7282b7308ccd2019c73d2f5d (patch) | |
| tree | 4708699df186d6b08d0e81dd19181b8d6b9f1742 | |
| parent | 323b81a08380c9660524b21a65d27c225d02c953 (diff) | |
| download | poky-5e88c4a6fe8a295c7282b7308ccd2019c73d2f5d.tar.gz | |
bitbake: runbuilds: code cleanup - whitespaces, long lines
Fixed following pylint warnings:
C0330(bad-continuation): Wrong hanging indentation before block.
C0326(bad-whitespace): No space allowed around keyword argument assignment
C0326(bad-whitespace): Exactly one space required before assignment
C0301(line-too-long): Line too long
(Bitbake rev: 0eecd660e374a4dbcefe4c59f4c8654bf3a0e937)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py index 7df81dc5d1..3421726e84 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | |||
| @@ -18,14 +18,13 @@ import signal | |||
| 18 | logger = logging.getLogger("toaster") | 18 | logger = logging.getLogger("toaster") |
| 19 | 19 | ||
| 20 | class Command(NoArgsCommand): | 20 | class Command(NoArgsCommand): |
| 21 | args = "" | 21 | args = "" |
| 22 | help = "Schedules and executes build requests as possible." | 22 | help = "Schedules and executes build requests as possible. "\ |
| 23 | "Does not return (interrupt with Ctrl-C)" | 23 | "Does not return (interrupt with Ctrl-C)" |
| 24 | |||
| 25 | 24 | ||
| 26 | @transaction.atomic | 25 | @transaction.atomic |
| 27 | def _selectBuildEnvironment(self): | 26 | def _selectBuildEnvironment(self): |
| 28 | bec = getBuildEnvironmentController(lock = BuildEnvironment.LOCK_FREE) | 27 | bec = getBuildEnvironmentController(lock=BuildEnvironment.LOCK_FREE) |
| 29 | bec.be.lock = BuildEnvironment.LOCK_LOCK | 28 | bec.be.lock = BuildEnvironment.LOCK_LOCK |
| 30 | bec.be.save() | 29 | bec.be.save() |
| 31 | return bec | 30 | return bec |
| @@ -75,17 +74,15 @@ class Command(NoArgsCommand): | |||
| 75 | else: | 74 | else: |
| 76 | errmsg = str(e) | 75 | errmsg = str(e) |
| 77 | 76 | ||
| 78 | BRError.objects.create(req = br, | 77 | BRError.objects.create(req=br, errtype=str(type(e)), errmsg=errmsg, |
| 79 | errtype = str(type(e)), | 78 | traceback=traceback.format_exc()) |
| 80 | errmsg = errmsg, | ||
| 81 | traceback = traceback.format_exc()) | ||
| 82 | br.state = BuildRequest.REQ_FAILED | 79 | br.state = BuildRequest.REQ_FAILED |
| 83 | br.save() | 80 | br.save() |
| 84 | bec.be.lock = BuildEnvironment.LOCK_FREE | 81 | bec.be.lock = BuildEnvironment.LOCK_FREE |
| 85 | bec.be.save() | 82 | bec.be.save() |
| 86 | 83 | ||
| 87 | def archive(self): | 84 | def archive(self): |
| 88 | for br in BuildRequest.objects.filter(state = BuildRequest.REQ_ARCHIVE): | 85 | for br in BuildRequest.objects.filter(state=BuildRequest.REQ_ARCHIVE): |
| 89 | if br.build == None: | 86 | if br.build == None: |
| 90 | br.state = BuildRequest.REQ_FAILED | 87 | br.state = BuildRequest.REQ_FAILED |
| 91 | else: | 88 | else: |
| @@ -102,14 +99,13 @@ class Command(NoArgsCommand): | |||
| 102 | BuildRequest.REQ_COMPLETED, | 99 | BuildRequest.REQ_COMPLETED, |
| 103 | BuildRequest.REQ_CANCELLING]) & | 100 | BuildRequest.REQ_CANCELLING]) & |
| 104 | Q(lock=BuildEnvironment.LOCK_LOCK) & | 101 | Q(lock=BuildEnvironment.LOCK_LOCK) & |
| 105 | Q(updated__lt=timezone.now() - timedelta(seconds = 30)) | 102 | Q(updated__lt=timezone.now() - timedelta(seconds=30)) |
| 106 | ).update(lock=BuildEnvironment.LOCK_FREE) | 103 | ).update(lock=BuildEnvironment.LOCK_FREE) |
| 107 | 104 | ||
| 108 | 105 | ||
| 109 | # update all Builds that were in progress and failed to start | 106 | # update all Builds that were in progress and failed to start |
| 110 | for br in BuildRequest.objects.filter( | 107 | for br in BuildRequest.objects.filter(state=BuildRequest.REQ_FAILED, |
| 111 | state=BuildRequest.REQ_FAILED, | 108 | build__outcome=Build.IN_PROGRESS): |
| 112 | build__outcome=Build.IN_PROGRESS): | ||
| 113 | # transpose the launch errors in ToasterExceptions | 109 | # transpose the launch errors in ToasterExceptions |
| 114 | br.build.outcome = Build.FAILED | 110 | br.build.outcome = Build.FAILED |
| 115 | for brerror in br.brerror_set.all(): | 111 | for brerror in br.brerror_set.all(): |
| @@ -126,7 +122,7 @@ class Command(NoArgsCommand): | |||
| 126 | 122 | ||
| 127 | 123 | ||
| 128 | # update all BuildRequests without a build created | 124 | # update all BuildRequests without a build created |
| 129 | for br in BuildRequest.objects.filter(build = None): | 125 | for br in BuildRequest.objects.filter(build=None): |
| 130 | br.build = Build.objects.create(project=br.project, | 126 | br.build = Build.objects.create(project=br.project, |
| 131 | completed_on=br.updated, | 127 | completed_on=br.updated, |
| 132 | started_on=br.created) | 128 | started_on=br.created) |
| @@ -151,10 +147,10 @@ class Command(NoArgsCommand): | |||
| 151 | 147 | ||
| 152 | # Make sure the LOCK is removed for builds which have been fully | 148 | # Make sure the LOCK is removed for builds which have been fully |
| 153 | # cancelled | 149 | # cancelled |
| 154 | for br in BuildRequest.objects.filter( | 150 | for br in BuildRequest.objects.filter(\ |
| 155 | Q(build__outcome=Build.CANCELLED) & | 151 | Q(build__outcome=Build.CANCELLED) & |
| 156 | Q(state=BuildRequest.REQ_CANCELLING) & | 152 | Q(state=BuildRequest.REQ_CANCELLING) & |
| 157 | ~Q(environment=None)): | 153 | ~Q(environment=None)): |
| 158 | br.environment.lock = BuildEnvironment.LOCK_FREE | 154 | br.environment.lock = BuildEnvironment.LOCK_FREE |
| 159 | br.environment.save() | 155 | br.environment.save() |
| 160 | 156 | ||
