kolla-ansible/docker/common/cinder-app/cinder-scheduler/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

36 lines
869 B
Bash
Executable File

#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-cinder.sh
fail_unless_db
check_required_vars CINDER_DB_NAME \
CINDER_DB_PASSWORD \
CINDER_DB_USER \
DB_ROOT_PASSWORD \
INIT_CINDER_DB \
MARIADB_SERVICE_HOST
cfg=/etc/cinder/cinder.conf
if [ "${INIT_CINDER_DB}" == "true" ]; then
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${CINDER_DB_NAME};
GRANT ALL PRIVILEGES ON ${CINDER_DB_NAME}.* TO
'${CINDER_DB_USER}'@'%' IDENTIFIED BY '${CINDER_DB_PASSWORD}'
EOF
su -s /bin/sh -c "cinder-manage db sync" cinder
fi
crudini --set $cfg \
DEFAULT \
log_file \
"${CINDER_SCHEDULER_LOG_FILE}"
echo "Starting cinder-scheduler"
exec /usr/bin/cinder-scheduler --config-file $cfg