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.
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/ SYS_PATH_ TECHNIQUE= rewrite /usr/local/ bin/pip2. 7 install -c /opt/stack/ new/requirement s/upper- constraints. txt 'libvirt- python> =1.2.5' 2>/dev/null python= ==3.2.0 (from -c /opt/stack/ new/requirement s/upper- constraints. txt (line 224)) python- 3.2.0 libvirt. VIR_MIGRATE_ POSTCOPY' POSTCOPY'
Somehow for this case, there's something wrong with local cached version.
------
~> sudo -H http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= SETUPTOOLS_
Collecting libvirt-
Installing collected packages: libvirt-python
Successfully installed libvirt-
sam@cdh3h6:~> python -c 'import libvirt;
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'VIR_MIGRATE_
~>
------
but if we tell pip to disable the cache with '--no-cache-dir', we won't run into this issue. SYS_PATH_ TECHNIQUE= rewrite /usr/local/ bin/pip2. 7 install --no-cache-dir -c /opt/stack/ new/requirement s/upper- constraints. txt 'libvirt- python> =1.2.5' 2>/dev/null python= ==3.2.0 (from -c /opt/stack/ new/requirement s/upper- constraints. txt (line 224)) python- 3.2.0.tar. gz (174kB) ####### ####### ####### #####| 184kB 324kB/s python- 3.2.0 libvirt. VIR_MIGRATE_ POSTCOPY'
------
~> sudo -H http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= SETUPTOOLS_
Collecting libvirt-
Downloading libvirt-
100% |######
Installing collected packages: libvirt-python
Running setup.py install for libvirt-python ... done
Successfully installed libvirt-
~> python -c 'import libvirt;
------
would suggest to disable the cable when devstack install pip packages.