Add env to make_subprocess
Due to a previous commit, a client of make_subprocess is making a call with an env parameter. As make_subprocess does not have such a parameter, image upload fails. This patch adds the env keyword argument to make_subprocess, and use that in the Popen call. Fixes bug 1216267 Change-Id: I8098b484067b54c15fe95f2bf84c5890db7ebcb3
This commit is contained in:
@@ -59,7 +59,7 @@ def _rename(src, dst):
|
||||
|
||||
|
||||
def make_subprocess(cmdline, stdout=False, stderr=False, stdin=False,
|
||||
universal_newlines=False, close_fds=True):
|
||||
universal_newlines=False, close_fds=True, env=None):
|
||||
"""Make a subprocess according to the given command-line string
|
||||
"""
|
||||
LOG.info("Running cmd '%s'" % " ".join(cmdline))
|
||||
@@ -69,6 +69,7 @@ def make_subprocess(cmdline, stdout=False, stderr=False, stdin=False,
|
||||
kwargs['stdin'] = stdin and subprocess.PIPE or None
|
||||
kwargs['universal_newlines'] = universal_newlines
|
||||
kwargs['close_fds'] = close_fds
|
||||
kwargs['env'] = env
|
||||
try:
|
||||
proc = subprocess.Popen(cmdline, **kwargs)
|
||||
except OSError, e:
|
||||
|
||||
Reference in New Issue
Block a user