From a19e1cdd00f0b3394f9146eab8cb7f7fe2b6e0f2 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Fri, 10 Oct 2014 11:33:43 -0400 Subject: [PATCH] keystone: exit on errors; cleanup Cause keystone start script to exit on any errors (permitting kubernetes to reschedule the pod). Closes-bug: 1379057 Change-Id: Ide2eac6495250c8cba91cf9b7409dcb313f6f74b --- docker/keystone/start.sh | 47 +++++++++++++++------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/docker/keystone/start.sh b/docker/keystone/start.sh index 7b0897eb08..aa90cc0924 100755 --- a/docker/keystone/start.sh +++ b/docker/keystone/start.sh @@ -1,20 +1,15 @@ #!/bin/bash -# Exit the container if MariaDB is not yet up - then depend on kube to restart -if [ -z "$MARIADB_PORT_3306_TCP_PORT" ]; then - exit 1 -fi +set -e : ${KEYSTONE_ADMIN_PASSWORD:=kolla} : ${ADMIN_TENANT_NAME:=admin} -if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then - KEYSTONE_ADMIN_TOKEN=$(openssl rand -hex 15) -fi - -if ! [ "$KEYSTONE_DB_PASSWORD" ]; then - KEYSTONE_DB_PASSWORD=$(openssl rand -hex 15) -fi +. /opt/kolla/kolla-common.sh +check_for_db +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_DB_PASSWORD \ + KEYSTONE_ADMIN_PASSWORD ADMIN_TENANT_NAME +dump_vars mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" mysql <