Avoid unbound variable error when installing pip

The pip_args variable is not initialized when installing pip for
bullseye resulting in an unbound variable error when running
install_python3_pip on that debian version.
This patch fixes the issue moving pip_args inizialization to a common
place.

Change-Id: I1603c97871449b4f73e3062a705d655e9454bf33
This commit is contained in:
Riccardo Pittau 2021-12-20 15:16:01 +01:00
parent f884b626b2
commit f576658a4f
1 changed files with 3 additions and 6 deletions

View File

@ -24,6 +24,9 @@ function install_python2_pip {
pip install $pip_args virtualenv pip install $pip_args virtualenv
} }
# force things to happen so our assumptions hold
pip_args="-U --force-reinstall"
if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then
# Default packages # Default packages
@ -98,9 +101,6 @@ if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then
;; ;;
esac esac
# force things to happen so our assumptions hold
pip_args="-U --force-reinstall"
# GENERAL WARNING : mixing packaged python libraries with # GENERAL WARNING : mixing packaged python libraries with
# pip-installed versions always creates issues. Upstream # pip-installed versions always creates issues. Upstream
# openstack-infra uses this a lot (especially devstack) but be # openstack-infra uses this a lot (especially devstack) but be
@ -270,9 +270,6 @@ else
apt-get -y install $packages apt-get -y install $packages
# force things to happen so our assumptions hold
pip_args="-U --force-reinstall"
install_python2_pip install_python2_pip
if [[ ${DIB_PYTHON_VERSION} == 3 ]]; then if [[ ${DIB_PYTHON_VERSION} == 3 ]]; then
install_python3_pip install_python3_pip