diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-10-01 21:43:20 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-10-02 13:14:51 +0200 |
commit | 7f0167770c1be1b0cb7a2ab8c657feac86c9b74d (patch) | |
tree | b5f6958e35054978b7e94200180193acb81f9815 | |
parent | 56ad550a92c9c0c65da52861e43ed7595131d0ef (diff) | |
download | samba-7f0167770c1be1b0cb7a2ab8c657feac86c9b74d.tar.gz samba-7f0167770c1be1b0cb7a2ab8c657feac86c9b74d.tar.bz2 samba-7f0167770c1be1b0cb7a2ab8c657feac86c9b74d.zip |
land: Avoid running things in a shell where not necessary.
-rwxr-xr-x | script/land.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/script/land.py b/script/land.py index d44704c879..a8a1a0191a 100755 --- a/script/land.py +++ b/script/land.py @@ -72,17 +72,18 @@ retry_task = [ ( "retry", done ''' % samba_master, "test/plain" ) ] + def run_cmd(cmd, dir=".", show=None, output=False, checkfail=True): if show is None: show = options.verbose if show: print("Running: '%s' in '%s'" % (cmd, dir)) if output: - return Popen([cmd], shell=True, stdout=PIPE, cwd=dir).communicate()[0] + return Popen(cmd, stdout=PIPE, cwd=dir).communicate()[0] elif checkfail: - return check_call(cmd, shell=True, cwd=dir) + return check_call(cmd, cwd=dir) else: - return call(cmd, shell=True, cwd=dir) + return call(cmd, cwd=dir) class builder(object): @@ -138,7 +139,11 @@ class builder(object): def kill(self): if self.proc is not None: - run_cmd("killbysubdir %s > /dev/null 2>&1" % self.sdir, checkfail=False) + try: + run_cmd(["killbysubdir", self.sdir], checkfail=False) + except OSError: + # killbysubdir doesn't exist ? + pass self.proc.terminate() self.proc.wait() self.proc = None |