Skip to content

Commit

Permalink
Fix package name when using heat-db-setup in rhel7
Browse files Browse the repository at this point in the history
In rhel7 mysql-server is replaced by mariadb-server, using
the right name to install package.

Closes-Bug: #1395726
Change-Id: I02e79a6f8da5bd082568c22d3efc4c231dfbd8c7
  • Loading branch information
Ethan Lynn committed Nov 26, 2014
1 parent 71ff003 commit 140f328
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bin/heat-db-setup
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ EOF

install_mysql_server() {
if [ -z "${ASSUME_YES}" ] ; then
$PACKAGE_INSTALL mysql-server
$PACKAGE_INSTALL $DB_SERVER
else
$PACKAGE_INSTALL -y mysql-server
$PACKAGE_INSTALL -y $DB_SERVER
fi
}

Expand Down Expand Up @@ -83,6 +83,15 @@ case "$1" in
PACKAGE_INSTALL="$ELEVATE yum install"
PACKAGE_STATUS="rpm -q"
SERVICE_MYSQLD="mysqld"
DB_SERVER="mysql-server"
# Install mariadb-server in rhel7 and fedora
if [[ -r /etc/redhat-release ]];then
ver=`grep -E -o '[0-9]+([.]?[0-9])*' /etc/redhat-release`
if [[ $ver >= 7 ]];then
SERVICE_MYSQLD="mariadb"
DB_SERVER="mariadb-server"
fi
fi
SERVICE_START="$ELEVATE service $SERVICE_MYSQLD start"
SERVICE_STATUS="service $SERVICE_MYSQLD status"
SERVICE_ENABLE="$ELEVATE chkconfig"
Expand All @@ -92,6 +101,7 @@ case "$1" in
PACKAGE_INSTALL="$ELEVATE apt-get install"
PACKAGE_STATUS="dpkg-query -s"
SERVICE_MYSQLD="mysql"
DB_SERVER="mysql-server"
SERVICE_START="$ELEVATE service $SERVICE_MYSQLD start"
SERVICE_STATUS="$ELEVATE service $SERVICE_MYSQLD status"
SERVICE_ENABLE=""
Expand Down

0 comments on commit 140f328

Please sign in to comment.