add IF EXISTS to DROP DATABASE statememnts,
make sure sudo is installed (prevents errors on miminal LXC installs),
This commit is contained in:
parent
3657ab3897
commit
40a37006f4
1 changed files with 31 additions and 27 deletions
10
stack.sh
10
stack.sh
|
@ -23,6 +23,10 @@ if ! grep -q natty /etc/lsb-release; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#The following makes fresh mininmal installs (i.e. LXCs) happy
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y sudo
|
||||||
|
|
||||||
# stack.sh keeps the list of **apt** and **pip** dependencies in external
|
# stack.sh keeps the list of **apt** and **pip** dependencies in external
|
||||||
# files, along with config templates and other useful files. You can find these
|
# files, along with config templates and other useful files. You can find these
|
||||||
# in the ``files`` directory (next to this script). We will reference this
|
# in the ``files`` directory (next to this script). We will reference this
|
||||||
|
@ -275,7 +279,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
|
||||||
mkdir -p $GLANCE_IMAGE_DIR
|
mkdir -p $GLANCE_IMAGE_DIR
|
||||||
|
|
||||||
# (re)create glance database
|
# (re)create glance database
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE glance;' || true
|
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE IF EXISTS glance;'
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE glance;'
|
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE glance;'
|
||||||
# Copy over our glance-registry.conf
|
# Copy over our glance-registry.conf
|
||||||
GLANCE_CONF=$GLANCE_DIR/etc/glance-registry.conf
|
GLANCE_CONF=$GLANCE_DIR/etc/glance-registry.conf
|
||||||
|
@ -361,7 +365,7 @@ fi
|
||||||
|
|
||||||
if [[ "$ENABLED_SERVICES" =~ "mysql" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "mysql" ]]; then
|
||||||
# (re)create nova database
|
# (re)create nova database
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE nova;' || true
|
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE IF EXISTS nova;'
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE nova;'
|
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE nova;'
|
||||||
$NOVA_DIR/bin/nova-manage db sync
|
$NOVA_DIR/bin/nova-manage db sync
|
||||||
|
|
||||||
|
@ -378,7 +382,7 @@ fi
|
||||||
|
|
||||||
if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
|
||||||
# (re)create keystone database
|
# (re)create keystone database
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE keystone;' || true
|
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE IF EXISTS keystone;'
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE keystone;'
|
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE keystone;'
|
||||||
|
|
||||||
# FIXME (anthony) keystone should use keystone.conf.example
|
# FIXME (anthony) keystone should use keystone.conf.example
|
||||||
|
|
Loading…
Reference in a new issue