WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xend: use popen2 module instead of subpro

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: use popen2 module instead of subprocess for Python 2.3
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 30 May 2009 02:30:22 -0700
Delivery-date: Sat, 30 May 2009 02:31:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1243585798 -3600
# Node ID ef6911934b6f7c85d51417455156466ff0507a56
# Parent  50e048b77ad180e6f32defde3c646b96a5c3626f
xend: use popen2 module instead of subprocess for Python 2.3

On Python 2.3, xend cannot started:
    File
    "usr/lib/python2.3/site-packages/xen/xend/server/BlktapController.=
py", line 3, in ?
      import subprocess
  ImportError: No module named subprocess

This patch uses `popen2' instead of `subprocess' for Python 2.3.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
---
 tools/python/xen/xend/server/BlktapController.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff -r 50e048b77ad1 -r ef6911934b6f 
tools/python/xen/xend/server/BlktapController.py
--- a/tools/python/xen/xend/server/BlktapController.py  Fri May 29 09:28:15 
2009 +0100
+++ b/tools/python/xen/xend/server/BlktapController.py  Fri May 29 09:29:58 
2009 +0100
@@ -1,6 +1,6 @@
 # Copyright (c) 2005, XenSource Ltd.
 import string, re
-import subprocess
+import popen2
 
 from xen.xend.server.blkif import BlkifController
 from xen.xend.XendLogging import log
@@ -27,9 +27,12 @@ blktap_disk_types = [
  
 def doexec(args, inputtext=None):
     """Execute a subprocess, then return its return code, stdout and stderr"""
-    proc = 
subprocess.Popen(args,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE,close_fds=True)
-    (stdout,stderr) = proc.communicate(inputtext)
-    rc = proc.returncode
+    proc = popen2.Popen3(args, True)
+    if inputtext != None:
+        proc.tochild.write(inputtext)
+    stdout = proc.fromchild
+    stderr = proc.childerr
+    rc = proc.poll()
     return (rc,stdout,stderr)
 
 def parseDeviceString(device):

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: use popen2 module instead of subprocess for Python 2.3, Xen patchbot-unstable <=