Merge "Check for nova DB availability in dependent containers"
This commit is contained in:
commit
4855d96c32
@ -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
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
: ${RABBIT_PASSWORD:=guest}
|
||||
: ${NETWORK_MANAGER:=nova}
|
||||
|
||||
check_for_db
|
||||
check_required_vars KEYSTONE_ADMIN_TOKEN NOVA_DB_PASSWORD \
|
||||
RABBITMQ_SERVICE_HOST GLANCE_API_SERVICE_HOST \
|
||||
KEYSTONE_PUBLIC_SERVICE_HOST PUBLIC_IP
|
||||
|
@ -7,8 +7,9 @@ set -e
|
||||
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
|
||||
NOVA_KEYSTONE_USER NOVA_KEYSTONE_PASSWORD \
|
||||
ADMIN_TENANT_NAME NOVA_API_SERVICE_HOST \
|
||||
NOVA_EC2_API_SERVICE_HOST PUBLIC_IP
|
||||
NOVA_EC2_API_SERVICE_HOST PUBLIC_IP NOVA_DB_NAME
|
||||
check_for_keystone
|
||||
check_for_db $NOVA_DB_NAME
|
||||
|
||||
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
|
||||
export SERVICE_ENDPOINT="http://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
|
||||
|
@ -4,4 +4,7 @@ set -e
|
||||
|
||||
. /opt/kolla/config-nova.sh
|
||||
|
||||
check_required_vars NOVA_DB_NAME
|
||||
check_for_db $NOVA_DB_NAME
|
||||
|
||||
exec /usr/bin/nova-scheduler
|
||||
|
Loading…
x
Reference in New Issue
Block a user