From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: toaster@yoctoproject.org
Subject: [PATCH 5/7] runbuilds: code cleanup - whitespaces, long lines
Date: Tue, 13 Sep 2016 16:21:02 +0300 [thread overview]
Message-ID: <435b6547f3b746d59ff4869ea6f8f53559fa0527.1473769704.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1473769704.git.ed.bartosh@linux.intel.com>
In-Reply-To: <cover.1473769704.git.ed.bartosh@linux.intel.com>
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
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
.../bldcontrol/management/commands/runbuilds.py | 34 ++++++++++------------
1 file 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 7df81dc..3421726 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
logger = logging.getLogger("toaster")
class Command(NoArgsCommand):
- args = ""
- help = "Schedules and executes build requests as possible."
- "Does not return (interrupt with Ctrl-C)"
-
+ args = ""
+ help = "Schedules and executes build requests as possible. "\
+ "Does not return (interrupt with Ctrl-C)"
@transaction.atomic
def _selectBuildEnvironment(self):
- bec = getBuildEnvironmentController(lock = BuildEnvironment.LOCK_FREE)
+ bec = getBuildEnvironmentController(lock=BuildEnvironment.LOCK_FREE)
bec.be.lock = BuildEnvironment.LOCK_LOCK
bec.be.save()
return bec
@@ -75,17 +74,15 @@ class Command(NoArgsCommand):
else:
errmsg = str(e)
- BRError.objects.create(req = br,
- errtype = str(type(e)),
- errmsg = errmsg,
- traceback = traceback.format_exc())
+ BRError.objects.create(req=br, errtype=str(type(e)), errmsg=errmsg,
+ traceback=traceback.format_exc())
br.state = BuildRequest.REQ_FAILED
br.save()
bec.be.lock = BuildEnvironment.LOCK_FREE
bec.be.save()
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:
br.state = BuildRequest.REQ_FAILED
else:
@@ -102,14 +99,13 @@ class Command(NoArgsCommand):
BuildRequest.REQ_COMPLETED,
BuildRequest.REQ_CANCELLING]) &
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 all Builds that were in progress and failed to start
- for br in BuildRequest.objects.filter(
- state=BuildRequest.REQ_FAILED,
- build__outcome=Build.IN_PROGRESS):
+ for br in BuildRequest.objects.filter(state=BuildRequest.REQ_FAILED,
+ build__outcome=Build.IN_PROGRESS):
# transpose the launch errors in ToasterExceptions
br.build.outcome = Build.FAILED
for brerror in br.brerror_set.all():
@@ -126,7 +122,7 @@ class Command(NoArgsCommand):
# 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,
completed_on=br.updated,
started_on=br.created)
@@ -151,10 +147,10 @@ class Command(NoArgsCommand):
# Make sure the LOCK is removed for builds which have been fully
# cancelled
- for br in BuildRequest.objects.filter(
- Q(build__outcome=Build.CANCELLED) &
- Q(state=BuildRequest.REQ_CANCELLING) &
- ~Q(environment=None)):
+ for br in BuildRequest.objects.filter(\
+ Q(build__outcome=Build.CANCELLED) &
+ Q(state=BuildRequest.REQ_CANCELLING) &
+ ~Q(environment=None)):
br.environment.lock = BuildEnvironment.LOCK_FREE
br.environment.save()
--
2.1.4
next prev parent reply other threads:[~2016-09-13 13:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-13 13:20 [PATCH 0/7] Fix for #8918: Change the way we handle queued builds Ed Bartosh
2016-09-13 13:20 ` [PATCH 1/7] toaster: implement signal_runbuilds function Ed Bartosh
2016-09-13 13:20 ` [PATCH 2/7] toaster: notify runbuilds when build status changes Ed Bartosh
2016-09-13 13:21 ` [PATCH 3/7] runbuilds: process builds on SIGUSR1 Ed Bartosh
2016-09-13 13:21 ` [PATCH 4/7] runbuilds: process builds on start Ed Bartosh
2016-09-13 13:21 ` Ed Bartosh [this message]
2016-09-13 13:21 ` [PATCH 6/7] runbuilds: code cleanup - remove unused imports Ed Bartosh
2016-09-13 13:21 ` [PATCH 7/7] toaster: unlock BuildEnvirnoment when build is done Ed Bartosh
2016-09-16 16:25 ` Michael Wood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=435b6547f3b746d59ff4869ea6f8f53559fa0527.1473769704.git.ed.bartosh@linux.intel.com \
--to=ed.bartosh@linux.intel.com \
--cc=toaster@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.