Ensure yum-utils is installed before using yum-config-manager

yum-utils provides yum-config-manager but the check for yum-utils is
currently being done after the first usage of yum-config-manager, which
fails if you don't have yum-utils already installed, so move it up
before the first usage of yum-config-manager.

Putting yum-utils in files/rpms/general doesn't help since
yum-config-manager is used in stack.sh before tools/install_prereqs.sh
is called.

Closes-Bug: #1467270

Change-Id: I74996c76838b7dc50d847e3bedb2d04dc55b4431
This commit is contained in:
Matt Riedemann 2015-06-21 09:02:59 -07:00
parent c342243cf8
commit 2f63da9e0e

View File

@ -263,6 +263,7 @@ gpgcheck=0
EOF EOF
# Enable a bootstrap repo. It is removed after finishing # Enable a bootstrap repo. It is removed after finishing
# the epel-release installation. # the epel-release installation.
is_package_installed yum-utils || install_package yum-utils
sudo yum-config-manager --enable epel-bootstrap sudo yum-config-manager --enable epel-bootstrap
yum_install epel-release || \ yum_install epel-release || \
die $LINENO "Error installing EPEL repo, cannot continue" die $LINENO "Error installing EPEL repo, cannot continue"
@ -270,7 +271,6 @@ EOF
sudo rm -f /etc/yum.repos.d/epel-bootstrap.repo sudo rm -f /etc/yum.repos.d/epel-bootstrap.repo
# ... and also optional to be enabled # ... and also optional to be enabled
is_package_installed yum-utils || install_package yum-utils
sudo yum-config-manager --enable rhel-7-server-optional-rpms sudo yum-config-manager --enable rhel-7-server-optional-rpms
RHEL_RDO_REPO_RPM=${RHEL7_RDO_REPO_RPM:-"https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm"} RHEL_RDO_REPO_RPM=${RHEL7_RDO_REPO_RPM:-"https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm"}