aboutsummaryrefslogtreecommitdiff
path: root/docker/fedora-rdo-base
diff options
context:
space:
mode:
authorMartin André <martin.andre@kvhasia.com>2015-01-19 15:06:28 +0900
committerMartin André <martin.andre@kvhasia.com>2015-01-21 09:34:01 +0900
commitf4b7ae95ac24f395e8d7ddd36cba362659fd29b4 (patch)
tree53ff0c851c967efd9cdaa7b5c79e169de7c7f321 /docker/fedora-rdo-base
parent91ca8d4b00c632bcf7a2a9903aa4cf584fee27e9 (diff)
downloadkolla-f4b7ae95ac24f395e8d7ddd36cba362659fd29b4.tar.gz
kolla-f4b7ae95ac24f395e8d7ddd36cba362659fd29b4.zip
Check for nova DB availability in dependent containers
When nova-api start and the nova database hasn't yet been created, it would create it itself, preventing the migration in nova-conductor to run and making it unable to start. This commit ensures that nova-api container will not try to steal nova-conductor's job of creating the nova database. Nova-scheduler reacts differently to the missing database and simply exits with a backtrace. This commit also prevents nova-scheduler to start when the nova database cannot be found. Change-Id: Ib6f7521151815faa7a26ec1d170df5a1cdb7fd63 Related-Bug: #1335804
Diffstat (limited to 'docker/fedora-rdo-base')
-rw-r--r--docker/fedora-rdo-base/kolla-common.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/docker/fedora-rdo-base/kolla-common.sh b/docker/fedora-rdo-base/kolla-common.sh
index c9ba03be5..56c658c43 100644
--- a/docker/fedora-rdo-base/kolla-common.sh
+++ b/docker/fedora-rdo-base/kolla-common.sh
@@ -56,12 +56,14 @@ check_for_neutron() {
}
# Exit unless we receive a successful response from the database server.
+# Optionally takes a database name to check for. Defaults to 'mysql'.
check_for_db() {
+ local database=${1:-mysql}
check_required_vars MARIADB_SERVICE_HOST DB_ROOT_PASSWORD
mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" \
- -e "select 1" mysql > /dev/null 2>&1 || {
- echo "ERROR: database is not available @ $MARIADB_SERVICE_HOST" >&2
+ -e "select 1" $database > /dev/null 2>&1 || {
+ echo "ERROR: database $database is not available @ $MARIADB_SERVICE_HOST" >&2
exit 1
}