[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: enable environment passing in xPopen3


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Fri, 23 Nov 2012 16:44:09 +0000
  • Delivery-date: Fri, 23 Nov 2012 16:44:17 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1353668775 0
# Node ID 0049de3827bcfe3488dc6c7b7a60327a562aee5c
# Parent  d76b7afc36afa2d92610b19a43696afe54c67224
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@xxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r d76b7afc36af -r 0049de3827bc tools/python/xen/util/xpopen.py
--- a/tools/python/xen/util/xpopen.py   Fri Nov 23 11:06:14 2012 +0000
+++ b/tools/python/xen/util/xpopen.py   Fri Nov 23 11:06:15 2012 +0000
@@ -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:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.