From 36be3145c76d185ecabac20c4df145b7f46f67b1 Mon Sep 17 00:00:00 2001 From: Mate Lakat Date: Sat, 24 Aug 2013 10:51:09 +0100 Subject: [PATCH] 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 --- plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py index cd932c328c..ccf1356ab7 100644 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py @@ -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: