diff --git a/sau/helpers.py b/sau/helpers.py index 6096abb..e1faf18 100644 --- a/sau/helpers.py +++ b/sau/helpers.py @@ -1,17 +1,21 @@ import logging +import os import subprocess import time import sau def exec_cmd(cmd, timeout=900, env = None): + my_env = os.environ.copy() + if env: + my_env.update(env) log = logging.getLogger(sau.LOGNAME) log.debug('Executing "{}"'.format(' '.join(cmd))) proc = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - env = env) + env = my_env) out = b"" err = b""