kolla/docker/common/glance/glance-registry/config-internal.sh
Swapnil Kulkarni 1c147e4def Update service helper scripts for variable changes
- Updated the required variables to be sorted so
  that they are better visible one on each line

- Removed variable defaults from each service scripts
  and added them to tools/genenv file which holds
  all default values

Change-Id: Ia7b1b08ba3f963b46b81434ce84f476d56890a93
Closes-Bug: #1476494
Closes-Bug: #1467652
2015-07-29 18:08:50 +00:00

29 lines
733 B
Bash
Executable File

#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-glance.sh
check_required_vars DB_ROOT_PASSWORD \
GLANCE_DB_NAME \
GLANCE_DB_PASSWORD \
GLANCE_DB_USER \
MARIADB_SERVICE_HOST
# lets wait for the DB to be available
wait_for 25 1 check_for_db
if [ "${INIT_GLANCE_DB}" == "true" ]; then
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${GLANCE_DB_NAME} DEFAULT CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON ${GLANCE_DB_NAME}.* TO
'${GLANCE_DB_USER}'@'%' IDENTIFIED BY '${GLANCE_DB_PASSWORD}'
EOF
/usr/bin/glance-manage db_sync
fi
exec /usr/bin/glance-registry