Merge lp:~jtran/nova/lp752074 into lp:~hudson-openstack/nova/trunk

Proposed by John Tran
Status: Merged
Approved by: Josh Kearney
Approved revision: 946
Merged at revision: 968
Proposed branch: lp:~jtran/nova/lp752074
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 45 lines (+30/-0)
2 files modified
tools/eventlet-patch (+24/-0)
tools/install_venv.py (+6/-0)
To merge this branch: bzr merge lp:~jtran/nova/lp752074
Reviewer Review Type Date Requested Status
Josh Kearney (community) Approve
Vish Ishaya (community) Approve
Review via email: mp+56495@code.launchpad.net

Commit message

Added a patch for python eventlet, when using install_venv.py (see FAQ # 1485)

To post a comment you must log in.
Revision history for this message
Vish Ishaya (vishvananda) wrote :

ah, very nice. LGTM

review: Approve
Revision history for this message
Josh Kearney (jk0) wrote :

Gonna need to set a commit message or description, otherwise the merge will fail.

review: Needs Fixing
Revision history for this message
Josh Kearney (jk0) wrote :

Thanks John!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'tools/eventlet-patch'
2--- tools/eventlet-patch 1970-01-01 00:00:00 +0000
3+++ tools/eventlet-patch 2011-04-06 01:38:22 +0000
4@@ -0,0 +1,24 @@
5+# HG changeset patch
6+# User Soren Hansen <soren@linux2go.dk>
7+# Date 1297678255 -3600
8+# Node ID 4c846d555010bb5a91ab4da78dfe596451313742
9+# Parent 5b7e9946c79f005c028eb63207cf5eb7bb21d1c3
10+Don't attempt to wrap GreenPipes in GreenPipe
11+
12+If the os module is monkeypatched, Python's standard subprocess module
13+will return greenio.GreenPipe instances for Popen objects' stdin, stdout,
14+and stderr attributes. However, eventlet.green.subprocess tries to wrap
15+these attributes in another greenio.GreenPipe, which GreenPipe refuses.
16+
17+diff -r 5b7e9946c79f -r 4c846d555010 eventlet/green/subprocess.py
18+--- a/eventlet/green/subprocess.py Sat Feb 05 13:05:05 2011 -0800
19++++ b/eventlet/green/subprocess.py Mon Feb 14 11:10:55 2011 +0100
20+@@ -27,7 +27,7 @@
21+ # eventlet.processes.Process.run() method.
22+ for attr in "stdin", "stdout", "stderr":
23+ pipe = getattr(self, attr)
24+- if pipe is not None:
25++ if pipe is not None and not type(pipe) == greenio.GreenPipe:
26+ wrapped_pipe = greenio.GreenPipe(pipe, pipe.mode, bufsize)
27+ setattr(self, attr, wrapped_pipe)
28+ __init__.__doc__ = subprocess_orig.Popen.__init__.__doc__
29
30=== modified file 'tools/install_venv.py'
31--- tools/install_venv.py 2011-01-11 18:11:30 +0000
32+++ tools/install_venv.py 2011-04-06 01:38:22 +0000
33@@ -103,6 +103,12 @@
34 pthfile = os.path.join(venv, "lib", "python2.6", "site-packages", "nova.pth")
35 f = open(pthfile, 'w')
36 f.write("%s\n" % ROOT)
37+ # Patch eventlet (see FAQ # 1485)
38+ patchsrc = os.path.join(ROOT, 'tools', 'eventlet-patch')
39+ patchfile = os.path.join(venv, "lib", "python2.6", "site-packages", "eventlet",
40+ "green", "subprocess.py")
41+ patch_cmd = "patch %s %s" % (patchfile, patchsrc)
42+ os.system(patch_cmd)
43
44
45 def print_help():