Commit f4543d86 authored by Betoule Marc's avatar Betoule Marc
Browse files

bug in previous commit

parent e98daaba
......@@ -197,7 +197,7 @@ class Environment(EnvironmentBase):
+glob(path.join(self._worker.pipe.get_data_dir(segx),path.join('*/',y)))
def logged_subprocess(self, args, shell=False, except=True):
def logged_subprocess(self, args, shell=False, except_on_failure=True):
""" Execute a subprocess and log its output.
Create files process_name.log and process_name.err
......@@ -206,7 +206,7 @@ class Environment(EnvironmentBase):
----------
args: a Task argument
shell: If set to True, the command is run via a shell
except: If set to True, raise an exception when command execution return non zero
except_on_failure: If set to True, raise an exception when command execution return non zero
Returns
-------
......@@ -221,7 +221,7 @@ class Environment(EnvironmentBase):
o.flush()
p=subprocess.Popen(args, stdout=o, stderr=e, shell=shell)
p.communicate()[0]
if except:
if except_on_failure:
if p.returncode != 0:
raise subprocess.CalledProcessError(p.returncode, args[0])
o.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment