From b0ad7284aa6e00559efa6e291b69eef1a2a1de33 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 15 Nov 2011 08:43:46 +0000 Subject: [PATCH] install_venv: apply eventlet patch correctly with python 2.7 (#890461) Looks like the fix for #884915 only works with RHEL6. Make it work correctly on Fedora 16. Change-Id: I8c996f20d49db688fd8e692bcd836dee693d362a --- tools/install_venv.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/install_venv.py b/tools/install_venv.py index 166801e829ec..f1d2ea86c0a2 100644 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -110,6 +110,9 @@ class Fedora(Distro): def yum_install(self, pkg, **kwargs): run_command(['sudo', 'yum', 'install', '-y', pkg], **kwargs) + def apply_patch(self, originalfile, patchfile): + run_command(['patch', originalfile, patchfile]) + def install_virtualenv(self): if self.check_cmd('virtualenv'): return @@ -143,9 +146,9 @@ class Fedora(Distro): self.yum_install('patch') # Apply the eventlet patch - run_command(['patch', - '.nova-venv/lib/python2.6/site-packages/eventlet/green/subprocess.py', - 'contrib/redhat-eventlet.patch']) + self.apply_patch(os.path.join(VENV, 'lib', PY_VERSION, 'site-packages', + 'eventlet/green/subprocess.py'), + 'contrib/redhat-eventlet.patch') def get_distro():