summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-02-15 17:42:07 +0000
committerGerrit Code Review <review@openstack.org>2019-02-15 17:42:07 +0000
commit64de1b386999a2c13e9040bcc6ff69724427af1d (patch)
tree22669ef61550fa4738b84198541ae5f9125c8858
parent6082b0b70ba2c739f6c53eb16c513b199ea756d2 (diff)
parentae6db7a387f8a2a779c5e9c33830d1f8d8af7971 (diff)
Merge "Fix broken symlinks from virtualenv 16.4.0 update"
-rwxr-xr-xscripts/setup_pip.sh28
1 files changed, 22 insertions, 6 deletions
diff --git a/scripts/setup_pip.sh b/scripts/setup_pip.sh
index 292d748..6edc367 100755
--- a/scripts/setup_pip.sh
+++ b/scripts/setup_pip.sh
@@ -2,6 +2,7 @@
2 2
3set -ex 3set -ex
4 4
5
5if [[ "${PYTHON3}" == "no" ]]; then 6if [[ "${PYTHON3}" == "no" ]]; then
6 TMP_VIRTUALENV="virtualenv" 7 TMP_VIRTUALENV="virtualenv"
7else 8else
@@ -13,12 +14,27 @@ fi
13if (( $(${TMP_VIRTUALENV} --version | cut -d. -f1) >= 14 )); then 14if (( $(${TMP_VIRTUALENV} --version | cut -d. -f1) >= 14 )); then
14 SETUPTOOLS="--no-setuptools" 15 SETUPTOOLS="--no-setuptools"
15fi 16fi
16${TMP_VIRTUALENV} --extra-search-dir=/tmp/wheels ${SETUPTOOLS} /tmp/venv
17source /tmp/venv/bin/activate
18 17
19# TODO: Remove virtualenv version pinning once a suitable fix is found 18# virtualenv 16.4.0 fixed symlink handling. The interaction of the new
20# to this issue: 19# corrected behavior with legacy bugs in packaged virtualenv releases in
21# http://lists.openstack.org/pipermail/openstack-discuss/2019-February/002592.html 20# distributions means we need to hold on to the pip bootstrap installation
22pip install --upgrade ${PIP_ARGS} virtualenv==16.3.0 21# chain to preserve symlinks. As distributions upgrade their default
22# installations we may not need this workaround in the future
23PIPBOOTSTRAP=/var/lib/pipbootstrap
24
25# Create the boostrap environment so we can get pip from virtualenv
26${TMP_VIRTUALENV} --extra-search-dir=/tmp/wheels ${SETUPTOOLS} ${PIPBOOTSTRAP}
27source ${PIPBOOTSTRAP}/bin/activate
28
29# Upgrade to the latest version of virtualenv
30pip install --upgrade ${PIP_ARGS} virtualenv
31
32# Forget the cached locations of python binaries
23hash -r 33hash -r
34
35# Create the virtualenv with the updated toolchain for openstack service
24virtualenv --extra-search-dir=/tmp/wheels /var/lib/openstack 36virtualenv --extra-search-dir=/tmp/wheels /var/lib/openstack
37
38# Deactivate the old bootstrap virtualenv and switch to the new one
39deactivate
40source /var/lib/openstack/bin/activate