Revision c803b052 lib/utils.py
b/lib/utils.py | ||
---|---|---|
151 | 151 |
if env is not None: |
152 | 152 |
cmd_env.update(env) |
153 | 153 |
|
154 |
if output is None: |
|
155 |
out, err, status = _RunCmdPipe(cmd, cmd_env, shell, cwd) |
|
156 |
else: |
|
157 |
status = _RunCmdFile(cmd, cmd_env, shell, output, cwd) |
|
158 |
out = err = "" |
|
154 |
try: |
|
155 |
if output is None: |
|
156 |
out, err, status = _RunCmdPipe(cmd, cmd_env, shell, cwd) |
|
157 |
else: |
|
158 |
status = _RunCmdFile(cmd, cmd_env, shell, output, cwd) |
|
159 |
out = err = "" |
|
160 |
except OSError, err: |
|
161 |
if err.errno == errno.ENOENT: |
|
162 |
raise errors.OpExecError("Can't execute '%s': not found (%s)" % |
|
163 |
(strcmd, err)) |
|
164 |
else: |
|
165 |
raise |
|
159 | 166 |
|
160 | 167 |
if status >= 0: |
161 | 168 |
exitcode = status |
Also available in: Unified diff