Merge "Set up keystone databases"

This commit is contained in:
Jenkins 2014-06-18 10:52:09 +00:00 committed by Gerrit Code Review
commit 5d70ef7330

View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
source "$TOP_DIR/config/paths"
source "$CONFIG_DIR/credentials"
source "$LIB_DIR/functions.guest"
exec_logfile
indicate_current_auto
#-------------------------------------------------------------------------------
# Create database Keystone, Glance, Quantum, Nova, and Cinder
function mysql_exe {
local CMD="$1"
echo mysql -u "root" -p"$DATABASE_PASSWORD" -e "$CMD"
}
function setup_database {
local DB=$1
mysql_exe "CREATE DATABASE $DB"
mysql_exe "GRANT ALL ON ${DB}.* TO '${DB}User'@'%' IDENTIFIED BY '${DB}Pass';"
}
setup_database keystone
setup_database glance
setup_database neutron
setup_database nova
setup_database cinder