install_venv: pip install M2Crypto doesn't work on Fedora

... so use the system m2crypto library instead.

M2Crypto won't build on Fedora because of some bizarre differences with
Fedora's OpenSSL headers. I can get it to build by doing e.g.

 $> python ./tools/install_venv.py
 $> cd .nova-venv/build/M2Crypto
 $> for i in SWIG/_ec.i SWIG/_evp.i; do sed -i -e "s/opensslconf/opensslconf-x86_64/" $i ; done
 $> cd -
 $> SWIG_FEATURES=-cpperraswarn ./tools/with_venv.sh pip install M2Crypto

but that's clearly no fun. It should be fine to just use the system
version.

Change-Id: I94c7464bf60ae586e16a2f38b7440cea8dc110e5
This commit is contained in:
Mark McLoughlin
2011-09-29 15:06:55 +01:00
parent 9f529afd47
commit 6c97436656
2 changed files with 13 additions and 1 deletions

View File

@@ -86,6 +86,9 @@ class Distro(object):
' requires virtualenv, please install it using your'
' favorite package management tool')
def install_m2crypto(self):
pip_install('M2Crypto')
class Fedora(Distro):
@@ -105,6 +108,14 @@ class Fedora(Distro):
super(Fedora, self).install_virtualenv()
#
# pip install M2Crypto fails on Fedora because of
# weird differences with OpenSSL headers
#
def install_m2crypto(self):
if not self.check_pkg('m2crypto'):
self.yum_install('m2crypto')
def get_distro():
if os.path.exists('/etc/fedora-release'):
@@ -145,6 +156,8 @@ def install_dependencies(venv=VENV):
pip_install('-r', PIP_REQUIRES)
get_distro().install_m2crypto()
# Tell the virtual env how to "import nova"
pthfile = os.path.join(venv, "lib", PY_VERSION, "site-packages",
"nova.pth")