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>
This commit is contained in:
parent
323b81a083
commit
5e88c4a6fe
|
@ -18,14 +18,13 @@ import signal
|
||||||
logger = logging.getLogger("toaster")
|
logger = logging.getLogger("toaster")
|
||||||
|
|
||||||
class Command(NoArgsCommand):
|
class Command(NoArgsCommand):
|
||||||
args = ""
|
args = ""
|
||||||
help = "Schedules and executes build requests as possible."
|
help = "Schedules and executes build requests as possible. "\
|
||||||
"Does not return (interrupt with Ctrl-C)"
|
"Does not return (interrupt with Ctrl-C)"
|
||||||
|
|
||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def _selectBuildEnvironment(self):
|
def _selectBuildEnvironment(self):
|
||||||
bec = getBuildEnvironmentController(lock = BuildEnvironment.LOCK_FREE)
|
bec = getBuildEnvironmentController(lock=BuildEnvironment.LOCK_FREE)
|
||||||
bec.be.lock = BuildEnvironment.LOCK_LOCK
|
bec.be.lock = BuildEnvironment.LOCK_LOCK
|
||||||
bec.be.save()
|
bec.be.save()
|
||||||
return bec
|
return bec
|
||||||
|
@ -75,17 +74,15 @@ class Command(NoArgsCommand):
|
||||||
else:
|
else:
|
||||||
errmsg = str(e)
|
errmsg = str(e)
|
||||||
|
|
||||||
BRError.objects.create(req = br,
|
BRError.objects.create(req=br, errtype=str(type(e)), errmsg=errmsg,
|
||||||
errtype = str(type(e)),
|
traceback=traceback.format_exc())
|
||||||
errmsg = errmsg,
|
|
||||||
traceback = traceback.format_exc())
|
|
||||||
br.state = BuildRequest.REQ_FAILED
|
br.state = BuildRequest.REQ_FAILED
|
||||||
br.save()
|
br.save()
|
||||||
bec.be.lock = BuildEnvironment.LOCK_FREE
|
bec.be.lock = BuildEnvironment.LOCK_FREE
|
||||||
bec.be.save()
|
bec.be.save()
|
||||||
|
|
||||||
def archive(self):
|
def archive(self):
|
||||||
for br in BuildRequest.objects.filter(state = BuildRequest.REQ_ARCHIVE):
|
for br in BuildRequest.objects.filter(state=BuildRequest.REQ_ARCHIVE):
|
||||||
if br.build == None:
|
if br.build == None:
|
||||||
br.state = BuildRequest.REQ_FAILED
|
br.state = BuildRequest.REQ_FAILED
|
||||||
else:
|
else:
|
||||||
|
@ -102,14 +99,13 @@ class Command(NoArgsCommand):
|
||||||
BuildRequest.REQ_COMPLETED,
|
BuildRequest.REQ_COMPLETED,
|
||||||
BuildRequest.REQ_CANCELLING]) &
|
BuildRequest.REQ_CANCELLING]) &
|
||||||
Q(lock=BuildEnvironment.LOCK_LOCK) &
|
Q(lock=BuildEnvironment.LOCK_LOCK) &
|
||||||
Q(updated__lt=timezone.now() - timedelta(seconds = 30))
|
Q(updated__lt=timezone.now() - timedelta(seconds=30))
|
||||||
).update(lock=BuildEnvironment.LOCK_FREE)
|
).update(lock=BuildEnvironment.LOCK_FREE)
|
||||||
|
|
||||||
|
|
||||||
# update all Builds that were in progress and failed to start
|
# update all Builds that were in progress and failed to start
|
||||||
for br in BuildRequest.objects.filter(
|
for br in BuildRequest.objects.filter(state=BuildRequest.REQ_FAILED,
|
||||||
state=BuildRequest.REQ_FAILED,
|
build__outcome=Build.IN_PROGRESS):
|
||||||
build__outcome=Build.IN_PROGRESS):
|
|
||||||
# transpose the launch errors in ToasterExceptions
|
# transpose the launch errors in ToasterExceptions
|
||||||
br.build.outcome = Build.FAILED
|
br.build.outcome = Build.FAILED
|
||||||
for brerror in br.brerror_set.all():
|
for brerror in br.brerror_set.all():
|
||||||
|
@ -126,7 +122,7 @@ class Command(NoArgsCommand):
|
||||||
|
|
||||||
|
|
||||||
# update all BuildRequests without a build created
|
# update all BuildRequests without a build created
|
||||||
for br in BuildRequest.objects.filter(build = None):
|
for br in BuildRequest.objects.filter(build=None):
|
||||||
br.build = Build.objects.create(project=br.project,
|
br.build = Build.objects.create(project=br.project,
|
||||||
completed_on=br.updated,
|
completed_on=br.updated,
|
||||||
started_on=br.created)
|
started_on=br.created)
|
||||||
|
@ -151,10 +147,10 @@ class Command(NoArgsCommand):
|
||||||
|
|
||||||
# Make sure the LOCK is removed for builds which have been fully
|
# Make sure the LOCK is removed for builds which have been fully
|
||||||
# cancelled
|
# cancelled
|
||||||
for br in BuildRequest.objects.filter(
|
for br in BuildRequest.objects.filter(\
|
||||||
Q(build__outcome=Build.CANCELLED) &
|
Q(build__outcome=Build.CANCELLED) &
|
||||||
Q(state=BuildRequest.REQ_CANCELLING) &
|
Q(state=BuildRequest.REQ_CANCELLING) &
|
||||||
~Q(environment=None)):
|
~Q(environment=None)):
|
||||||
br.environment.lock = BuildEnvironment.LOCK_FREE
|
br.environment.lock = BuildEnvironment.LOCK_FREE
|
||||||
br.environment.save()
|
br.environment.save()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue