aboutsummaryrefslogtreecommitdiffstats
path: root/tools/python
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2012-11-23 11:06:15 +0000
committerOlaf Hering <olaf@aepfle.de>2012-11-23 11:06:15 +0000
commit4369b2cd6fbeb34c537a68df26debb0ab36026f9 (patch)
tree934744f705de9079a396d6f10cb689975b11b711 /tools/python
parentb1f2c77ffda88e16665078e3cf5b8fd20647d1e5 (diff)
downloadxen-4369b2cd6fbeb34c537a68df26debb0ab36026f9.tar.gz
xen-4369b2cd6fbeb34c537a68df26debb0ab36026f9.tar.bz2
xen-4369b2cd6fbeb34c537a68df26debb0ab36026f9.zip
xend: enable environment passing in xPopen3
In changeset 19990:38dd208e1d95 a new parameter 'env' was added to xPopen3, but no code was added to actually pass the environment down to execvpe. Also, the new code was unreachable. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/python')
-rw-r--r--tools/python/xen/util/xpopen.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/python/xen/util/xpopen.py b/tools/python/xen/util/xpopen.py
index 66c2d9a5d8..75aa08e678 100644
--- a/tools/python/xen/util/xpopen.py
+++ b/tools/python/xen/util/xpopen.py
@@ -104,7 +104,7 @@ class xPopen3:
os.dup2(c2pwrite, 1)
if capturestderr:
os.dup2(errin, 2)
- self._run_child(cmd)
+ self._run_child(cmd, env)
os.close(p2cread)
self.tochild = os.fdopen(p2cwrite, 'w', bufsize)
os.close(c2pwrite)
@@ -116,7 +116,7 @@ class xPopen3:
self.childerr = None
_active.append(self)
- def _run_child(self, cmd):
+ def _run_child(self, cmd, env):
if isinstance(cmd, basestring):
cmd = ['/bin/sh', '-c', cmd]
for i in range(3, MAXFD):
@@ -127,7 +127,6 @@ class xPopen3:
except OSError:
pass
try:
- os.execvp(cmd[0], cmd)
if env is None:
os.execvp(cmd[0], cmd)
else: