Install python3 tools and libraries instead of python2

Change-Id: Ibe3b9fe5f3ec46524c7ac039789163d77dacb710
This commit is contained in:
Jonathan Rosser 2020-03-01 19:58:41 +00:00 committed by Dmitriy Rabotyagov
parent 1d21a35fad
commit b4355c9360
3 changed files with 14 additions and 14 deletions

View File

@ -29,9 +29,6 @@ gcc
git-core [platform:dpkg platform:suse]
libssl-dev [platform:dpkg]
libffi-dev [platform:dpkg]
python2.7 [platform:dpkg]
python-apt [platform:dpkg]
python-dev [platform:dpkg]
python3 [platform:dpkg]
python3-apt [platform:dpkg]
python3-dev [platform:dpkg]
@ -41,13 +38,15 @@ gcc-c++ [platform:rpm]
git [platform:rpm !platform:suse]
libffi-devel [platform:rpm]
openssl-devel [platform:rpm]
python-devel [platform:rpm]
python2-dnf [platform:fedora]
python3-dnf [platform:fedora]
python3-devel [platform:rpm]
# Base requirements for Gentoo
git [platform:gentoo]
# For SELinux
libselinux-python [platform:redhat]
libsemanage-python [platform:redhat]
libselinux-python3 [platform:redhat]
libsemanage-python3 [platform:redhat]
# Required for compressing collected log files in CI
gzip

View File

@ -136,6 +136,7 @@
- item['scm'] == "git" or item['scm'] is undefined
vars:
ansible_python_interpreter: "/usr/bin/python3"
homedir: "{{ lookup('env', 'TESTING_HOME') }}"
role_file: "{{ lookup('env', 'ANSIBLE_ROLE_REQUIREMENTS_PATH') }}"
osa_roles: "{{ lookup('file', role_file) | from_yaml }}"

View File

@ -55,17 +55,17 @@ case "${ID,,}" in
# 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:-}"
pkg_list="python3-devel redhat-lsb-core yum-utils ${extra_redhat_deps:-}"
;;
fedora)
pkg_list="python-devel redhat-lsb-core redhat-rpm-config yum-utils"
pkg_list="python3-devel redhat-lsb-core redhat-rpm-config yum-utils"
;;
ubuntu|debian)
# NOTE(jrosser) remove this once infra debian images point to the upstream security repo
if `/bin/grep -q "stretch" /etc/os-release` && [ -f "/etc/apt/sources.list.d/security.list" ]; then
echo 'deb http://security.debian.org stretch/updates main contrib' | sudo tee /etc/apt/sources.list.d/security.list > /dev/null
fi
pkg_list="python-dev lsb-release"
pkg_list="python3-dev lsb-release"
sudo apt-get update
;;
gentoo)
@ -80,16 +80,16 @@ esac
eval sudo ${pkg_mgr_cmd} ${pkg_list}
# Install pip
if ! which pip &>/dev/null; then
if ! which pip3 &>/dev/null; then
curl --silent --show-error --retry 5 \
https://bootstrap.pypa.io/3.3/get-pip.py | sudo python2.7
https://bootstrap.pypa.io/3.3/get-pip.py | sudo python3
fi
# Install bindep and tox
if [[ "${ID,,}" == "centos" ]] && [[ ${VERSION_ID} == "7" ]]; then
sudo pip install 'bindep>=2.4.0' 'tox<=3.14.0'
sudo pip3 install 'bindep>=2.4.0' 'tox<=3.14.0'
else
sudo pip install 'bindep>=2.4.0' tox
sudo pip3 install 'bindep>=2.4.0' tox
fi
if [[ "${ID,,}" == "fedora" ]]; then