Browse Source

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
changes/26/822326/3
Riccardo Pittau 5 months ago
parent
commit
f576658a4f
  1. 9
      diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip

9
diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip vendored

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

Loading…
Cancel
Save