Pin version of tox used for Centos-7 tests

Tox has virtalenv as a dependancy and will install it using pip during
tox installation if a suitable version is not present.

This patch pins the version of tox to one which is compatible with the
version of virtualenv in the centos-7 python-virtualenv distro package.

Without this patch, tests which include the openstack_hosts role
will install the python-virtualenv distro package on top of the pip
intalled virtualenv from the tox install, and this results in a broken
package and the test fails.

Change-Id: I0c07bc46f5b9a519232620f2d79d6a894f317921
This commit is contained in:
Jonathan Rosser 2020-03-03 13:44:33 +00:00
parent 222a297953
commit 220b4ecac2

View File

@ -51,7 +51,11 @@ case "${ID,,}" in
pkg_list="ca-certificates-mozilla python-devel python-xml lsb-release ${extra_suse_deps:-}"
;;
amzn|centos|rhel)
pkg_list="python-devel redhat-lsb-core yum-utils"
# NOTE(jrosser) on centos7 we ensure that the distro version of virtualenv is present to avoid
# tox later installing virtualenv as a dependancy with pip, and breaking later tests with
# openstack_hosts which correctly install the python-virtualenv distro package
[[ "${VERSION_ID}" == "7" ]] && extra_redhat_deps="python-virtualenv"
pkg_list="python-devel redhat-lsb-core yum-utils ${extra_redhat_deps:-}"
;;
fedora)
pkg_list="python-devel redhat-lsb-core redhat-rpm-config yum-utils"
@ -82,7 +86,11 @@ if ! which pip &>/dev/null; then
fi
# Install bindep and tox
sudo pip install 'bindep>=2.4.0' tox
if [[ "${ID,,}" == "centos" ]] && [[ ${VERSION_ID} == "7" ]]; then
sudo pip install 'bindep>=2.4.0' 'tox<=3.14.0'
else
sudo pip install 'bindep>=2.4.0' tox
fi
if [[ "${ID,,}" == "fedora" ]]; then
sudo dnf -y install redhat-lsb-core yum-utils