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
692 B
Bash
Executable File

#!/bin/bash
set -e
. /opt/kolla/config-nova.sh
check_required_vars INIT_NOVA_DB \
NOVA_DB_NAME \
NOVA_DB_PASSWORD \
NOVA_DB_USER
fail_unless_db
cfg=/etc/nova/nova.conf
# configure logging
crudini --set $cfg DEFAULT log_file "${NOVA_CONDUCTOR_LOG_FILE}"
if [ "${INIT_NOVA_DB}" == "true" ]; then
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${NOVA_DB_NAME};
GRANT ALL PRIVILEGES ON ${NOVA_DB_NAME}.* TO
'${NOVA_DB_USER}'@'%' IDENTIFIED BY '${NOVA_DB_PASSWORD}'
EOF
nova-manage db sync
fi
exec /usr/bin/nova-conductor --config-file /etc/nova/nova.conf