run_tests fails in venv on my setup (lucid)

Bug #880905 reported by Lorin Hochstein
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Lorin Hochstein

Bug Description

Recently, run_tests.sh inside of a virtualenv stopped working on my setup (lucid). With git bisect, I traced it down to this commit:

commit 7eeee584ad64b5a76c029641243a8fca2c875772
Author: Mark McLoughlin <email address hidden>
Date: Thu Sep 29 15:06:54 2011 +0100

    install_venv: don't use --no-site-packages with virtualenv

    libvirt isn't listed in pip-requires because (a) it's not in PyPi and
    (b) you always want to use libvirt's python bindings that matches the
    version of libvirt installed on the system.

    Currently, running nova-compute in virtualenv fails because libvirt
    can't be imported. The --no-site-packages flag is what prevents this.
    Everything seems to work fine without it. To verify, try deleting the
    no-global-site-packages.txt from your .nova-venv.

    Change-Id: I1df5e8e3c4426ca333c2d6b5b4fa8ece144dddf3

diff --git a/tools/install_venv.py b/tools/install_venv.py
index a137f11..912d0a2 100644
--- a/tools/install_venv.py
+++ b/tools/install_venv.py
@@ -89,7 +89,7 @@ def create_virtualenv(venv=VENV):
     virtual environment
     """
     print 'Creating venv...',
- run_command(['virtualenv', '-q', '--no-site-packages', VENV])
+ run_command(['virtualenv', '-q', VENV])
     print 'done.'
     print 'Installing pip in virtualenv...',
     if not run_command(['tools/with_venv.sh', 'easy_install', 'pip']).strip():

Since it's related to --no-site-packages, it's probably interfering with some package setup on my machine, but I'm not sure what packages are interfering.

Here's the error message for the package that's failing (glance). The full output is attached.

$ ./run_tests.sh -f -V
Cleaning virtualenv...
done.
Creating venv... done.
Installing pip in virtualenv... done.
Installing dependencies with pip (this can take a while)...
...
  Running setup.py install for glance
    ERROR: Python module kombu.connection not found
    ERROR: Python module swift.common.client not found
    ERROR: Python module xattr not found
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: option --single-version-externally-managed not recognized
    Complete output from command /home/lorin/nova/.nova-venv/bin/python -c "import setuptools;__file__='/home/lorin/nova/.nova-venv/build/glance/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-Xcyxmf-record/install-record.txt --install-headers /home/lorin/nova/.nova-venv/include/site/python2.6:
    ERROR: Python module kombu.connection not found

ERROR: Python module swift.common.client not found

ERROR: Python module xattr not found

usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

   or: -c --help [cmd1 cmd2 ...]

   or: -c --help-commands

   or: -c cmd --help

error: option --single-version-externally-managed not recognized

----------------------------------------
Command /home/lorin/nova/.nova-venv/bin/python -c "import setuptools;__file__='/home/lorin/nova/.nova-venv/build/glance/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-Xcyxmf-record/install-record.txt --install-headers /home/lorin/nova/.nova-venv/include/site/python2.6 failed with error code 1
Storing complete log in /home/lorin/.pip/pip.log
Command "tools/with_venv.sh pip install --upgrade -r /home/lorin/nova/tools/pip-requires" failed.

Revision history for this message
Lorin Hochstein (lorinh) wrote :
description: updated
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/1208
Committed: http://github.com/openstack/nova/commit/b08bd96ce5bf290ac6198079ad2dce71e675b481
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit b08bd96ce5bf290ac6198079ad2dce71e675b481
Author: Lorin Hochstein <email address hidden>
Date: Sun Oct 30 09:00:59 2011 -0400

    Optional --no-site-packages in venv

    Added a flag to run_tests.sh to allow user to optionally install venv with --no-site-packages.

    This fixes bug 880905

    Change-Id: Ic645e0ec56c90b72fef526ebc9f55975d446e2ae

Changed in nova:
status: New → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Mark McLoughlin (markmc)
Changed in nova:
assignee: nobody → Lorin Hochstein (lorinh)
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-1 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.