Comment 1 for bug 1682692

Revision history for this message
Sam Wan (sam-wan) wrote :

It turns out to be some issue with local cached libvirt-python.

devstack uses 'sudo -H' to install pip package
------
./inc/python: local sudo_pip="sudo -H"
------

with '-H', pip will try to use the local cached version. In this case, it uses /root/.cache/pip/
Somehow for this case, there's something wrong with local cached version.
------
~> sudo -H http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite /usr/local/bin/pip2.7 install -c /opt/stack/new/requirements/upper-constraints.txt 'libvirt-python>=1.2.5' 2>/dev/null
Collecting libvirt-python===3.2.0 (from -c /opt/stack/new/requirements/upper-constraints.txt (line 224))
Installing collected packages: libvirt-python
Successfully installed libvirt-python-3.2.0
sam@cdh3h6:~> python -c 'import libvirt;libvirt.VIR_MIGRATE_POSTCOPY'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'VIR_MIGRATE_POSTCOPY'
~>
------

but if we tell pip to disable the cache with '--no-cache-dir', we won't run into this issue.
------
~> sudo -H http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite /usr/local/bin/pip2.7 install --no-cache-dir -c /opt/stack/new/requirements/upper-constraints.txt 'libvirt-python>=1.2.5' 2>/dev/null
Collecting libvirt-python===3.2.0 (from -c /opt/stack/new/requirements/upper-constraints.txt (line 224))
  Downloading libvirt-python-3.2.0.tar.gz (174kB)
    100% |################################| 184kB 324kB/s
Installing collected packages: libvirt-python
  Running setup.py install for libvirt-python ... done
Successfully installed libvirt-python-3.2.0
~> python -c 'import libvirt;libvirt.VIR_MIGRATE_POSTCOPY'
------

would suggest to disable the cable when devstack install pip packages.