diff --git a/sau/helpers.py b/sau/helpers.py index 8f2c551..0125917 100644 --- a/sau/helpers.py +++ b/sau/helpers.py @@ -12,6 +12,9 @@ def exec_cmd(cmd, timeout=900, env = None): stdout=subprocess.PIPE, stderr=subprocess.PIPE, env = env) + out = b"" + err = b"" + try: out, err = proc.communicate(timeout=timeout) except subprocess.TimeoutExpired as err: @@ -22,7 +25,6 @@ def exec_cmd(cmd, timeout=900, env = None): log.error('Command "{}" would not be killed, forcing a termination'.format(' '.join(cmd))) proc.terminate() time.sleep(5) - return (proc.returncode, out.decode('utf-8'), err.decode('utf-8'))