summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-10-01 21:55:10 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-10-02 13:14:51 +0200
commit916904443d6df7f9bd7502f31f1f7734e845a48a (patch)
tree0fc7aaffab203de953c2b591975c30f4b131b6fe /script
parent7f0167770c1be1b0cb7a2ab8c657feac86c9b74d (diff)
downloadsamba-916904443d6df7f9bd7502f31f1f7734e845a48a.tar.gz
samba-916904443d6df7f9bd7502f31f1f7734e845a48a.tar.bz2
samba-916904443d6df7f9bd7502f31f1f7734e845a48a.zip
Several smaller cleanups, use python coding style.
Diffstat (limited to 'script')
-rwxr-xr-xscript/land.py33
1 files changed, 16 insertions, 17 deletions
diff --git a/script/land.py b/script/land.py
index a8a1a0191a..67564a18b7 100755
--- a/script/land.py
+++ b/script/land.py
@@ -4,7 +4,7 @@
# Copyright Jelmer Vernooij 2010
# released under GNU GPL v3 or later
-from subprocess import call, check_call,Popen, PIPE
+from subprocess import call, check_call, Popen, PIPE
import os, tarfile, sys, time
from optparse import OptionParser
import smtplib
@@ -86,7 +86,7 @@ def run_cmd(cmd, dir=".", show=None, output=False, checkfail=True):
return call(cmd, cwd=dir)
-class builder(object):
+class Builder(object):
'''handle build of one directory'''
def __init__(self, name, sequence):
@@ -116,7 +116,7 @@ class builder(object):
cleanup_list.append(self.prefix)
os.makedirs(self.sdir)
run_cmd("rm -rf %s" % self.sdir)
- run_cmd("git clone --shared %s %s" % (gitroot, self.sdir))
+ run_cmd(["git", "clone", "--shared", gitroot, self.sdir])
self.start_next()
def start_next(self):
@@ -157,7 +157,7 @@ class builder(object):
return "%s: [%s] failed '%s' with status %d" % (self.name, self.stage, self.cmd, self.status)
-class buildlist(object):
+class BuildList(object):
'''handle build of multiple directories'''
def __init__(self, tasklist, tasknames):
@@ -172,10 +172,10 @@ class buildlist(object):
if tasknames == []:
tasknames = tasklist
for n in tasknames:
- b = builder(n, tasks[n])
+ b = Builder(n, tasks[n])
self.tlist.append(b)
if options.retry:
- self.retry = builder('retry', retry_task)
+ self.retry = Builder('retry', retry_task)
self.need_retry = False
def kill_kids(self):
@@ -408,7 +408,7 @@ if options.retry:
raise Exception('You can only use --retry if you also rebase')
testbase = "%s/b%u" % (options.testbase, os.getpid())
-test_master = "%s/master" % testbase
+test_master = os.path.join(testbase, "master")
if options.repository is not None:
repository = options.repository
@@ -444,7 +444,7 @@ while True:
rebase_tree(options.rebase)
elif options.rebase_master:
rebase_tree(samba_master)
- blist = buildlist(tasks, args)
+ blist = BuildList(tasks, args)
if options.tail:
blist.start_tail()
(status, failed_task, failed_stage, failed_tag, errstr) = blist.run()
@@ -477,15 +477,14 @@ if status == 0:
blist.remove_logs()
cleanup()
print(errstr)
- sys.exit(0)
-
-# something failed, gather a tar of the logs
-blist.tarlogs("logs.tar.gz")
+else:
+ # something failed, gather a tar of the logs
+ blist.tarlogs("logs.tar.gz")
-if options.email is not None:
- email_failure(status, failed_task, failed_stage, failed_tag, errstr)
+ if options.email is not None:
+ email_failure(status, failed_task, failed_stage, failed_tag, errstr)
-cleanup()
-print(errstr)
-print("Logs in logs.tar.gz")
+ cleanup()
+ print(errstr)
+ print("Logs in logs.tar.gz")
sys.exit(status)