From 097240c226857a72848726017322bda30dfe645c Mon Sep 17 00:00:00 2001 From: Bernard Cafarelli Date: Fri, 1 Jul 2016 12:14:38 +0200 Subject: [PATCH] Export YUM variable in centos bases Other fedora/centos elements can use the YUM variable, already set in some base elements (fedora, centos-minimal). This commit also exports it for centos/centos7. Set a fallback value in pip-and-virtualenv element. Change-Id: I681d77b924be035c81043bb34c72ec5f859e7108 Closes-Bug: 1598087 --- elements/centos/environment.d/10-centos6-distro-name.bash | 3 +++ elements/centos7/environment.d/10-centos7-distro-name.bash | 5 ++++- .../pip-and-virtualenv-source-install/01-install-pip | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/elements/centos/environment.d/10-centos6-distro-name.bash b/elements/centos/environment.d/10-centos6-distro-name.bash index 35971026..c65178fd 100644 --- a/elements/centos/environment.d/10-centos6-distro-name.bash +++ b/elements/centos/environment.d/10-centos6-distro-name.bash @@ -1,2 +1,5 @@ export DISTRO_NAME=centos export DIB_RELEASE=${DIB_RELEASE:-GenericCloud} + +# Useful for elements that work with fedora (dnf) & centos +export YUM=${YUM:-yum} diff --git a/elements/centos7/environment.d/10-centos7-distro-name.bash b/elements/centos7/environment.d/10-centos7-distro-name.bash index 1afdc622..c9476d07 100644 --- a/elements/centos7/environment.d/10-centos7-distro-name.bash +++ b/elements/centos7/environment.d/10-centos7-distro-name.bash @@ -1,2 +1,5 @@ -export DIB_RELEASE=GenericCloud export DISTRO_NAME=centos7 +export DIB_RELEASE=GenericCloud + +# Useful for elements that work with fedora (dnf) & centos +export YUM=${YUM:-yum} diff --git a/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/01-install-pip b/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/01-install-pip index 06af08b9..4efd1a21 100755 --- a/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/01-install-pip +++ b/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/01-install-pip @@ -16,7 +16,7 @@ if [[ $DISTRO_NAME =~ (centos|fedora) ]]; then # on somebody does a "yum install python-virtualenv" and goes and # overwrites the pip installed version with the packaged version, # leading to all sorts of weird version issues. - ${YUM} install -y python-virtualenv python-pip python-setuptools + ${YUM:-yum} install -y python-virtualenv python-pip python-setuptools # install pip; this overwrites packaged pip python /tmp/get-pip.py