diff options
Diffstat (limited to 'deploy/common.py')
-rw-r--r-- | deploy/common.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/deploy/common.py b/deploy/common.py index 3cd3e0e6e..9c0f8abd1 100644 --- a/deploy/common.py +++ b/deploy/common.py @@ -77,6 +77,17 @@ def run_proc(cmd): return process +def run_proc_wait_terminated(process): + response = process.communicate()[0].strip() + return_code = process.returncode + return response, return_code + + +def run_proc_kill(process): + response = process.kill() + return response + + def parse(printout): parsed_list = [] lines = printout.splitlines() @@ -99,8 +110,10 @@ def clean(lines): return parsed if len(parsed_list) == 1 else parsed_list -def err(message): +def err(message, fun = None, *args): LOG.error('%s\n' % message) + if fun: + fun(*args) sys.exit(1) |