From a672e6081340b022660432e20fdd3985b0361505 Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Thu, 9 Apr 2015 00:22:29 +0800 Subject: [PATCH] Fix setup scripts in tools folder Fix some error when I using these tools. Change-Id: Icf6b3546741f4e5d3e8b1d550c1462d0ad59e2ca --- install.sh | 2 +- tools/senlin-db-recreate | 10 +++++----- tools/setup-service | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 6f617ebb4..b81f16fbb 100755 --- a/install.sh +++ b/install.sh @@ -73,7 +73,7 @@ basic_configuration() { if echo $conf_path | grep ".conf$" >/dev/null 2>&1 then iniset $target DEFAULT auth_encryption_key `hexdump -n 16 -v -e '/1 "%02x"' /dev/random` - iniset $target database connection "mysql://senlin:senlin@localhost/senlin" + iniset $target database connection "mysql://senlin:senlin@localhost/senlin?charset=utf8" BRIDGE_IP=127.0.0.1 diff --git a/tools/senlin-db-recreate b/tools/senlin-db-recreate index 3ddedd837..b0bc63cba 100755 --- a/tools/senlin-db-recreate +++ b/tools/senlin-db-recreate @@ -1,14 +1,14 @@ #!/bin/bash -MYSQL_ROOT_PW=openstack -MYSQL_SENLIN_PW=openstack +MYSQL_ROOT_PW=${MYSQL_ROOT_PW:-openstack} +MYSQL_SENLIN_PW=${MYSQL_SENLIN_PW:-openstack} echo "Recreating 'senlin' database." cat << EOF | mysql -u root --password=${MYSQL_ROOT_PW} -DROP DATABASE senlin; +DROP DATABASE IF EXISTS senlin; CREATE DATABASE senlin DEFAULT CHARACTER SET utf8; -GRANT ALL ON senlin.* TO 'root'@'localhost' IDENTIFIED BY '${MYSQL_SENLIN_PW}'; -GRANT ALL ON senlin.* TO 'root'@'%' IDENTIFIED BY '${MYSQL_SENLIN_PW}'; +GRANT ALL ON senlin.* TO 'senlin'@'localhost' IDENTIFIED BY '${MYSQL_SENLIN_PW}'; +GRANT ALL ON senlin.* TO 'senlin'@'%' IDENTIFIED BY '${MYSQL_SENLIN_PW}'; flush privileges; EOF diff --git a/tools/setup-service b/tools/setup-service index 743ac4df1..c37588f7d 100755 --- a/tools/setup-service +++ b/tools/setup-service @@ -1,6 +1,6 @@ #!/bin/bash -if [ $# -ne 2 ]; then +if [ $# -ne 1 ]; then echo "Usage: `basename $0` " exit -1 fi