From 4592e3884fcbe401d0360003d74b3b0dfb9e4dfc Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Thu, 2 Oct 2014 17:12:07 -0400 Subject: [PATCH] Updates to glance start scripts, db and user/role creation - adding db sync and db creation as utf8 - fixing user and role creation Partial-blueprint: kube-glance-container Change-Id: I15be99f26483e490fccc23d029f39645c13c724b --- docker/glance/glance-base/config-glance.sh | 21 +++++++-------- docker/glance/glance-registry/start.sh | 31 +++++++++++----------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docker/glance/glance-base/config-glance.sh b/docker/glance/glance-base/config-glance.sh index ae15b1a782..2b2ae04738 100644 --- a/docker/glance/glance-base/config-glance.sh +++ b/docker/glance/glance-base/config-glance.sh @@ -12,8 +12,8 @@ cfg=/etc/glance/glance-${service}.conf : ${ADMIN_TENANT_NAME:=admin} if ! [ "$GLANCE_DB_PASSWORD" ]; then - echo "*** Missing GLANCE_DB_PASSWORD" >&2 - exit 1 + echo "*** Missing GLANCE_DB_PASSWORD" >&2 + exit 1 fi crudini --del $cfg \ @@ -25,9 +25,9 @@ crudini --set $cfg \ "${GLANCE_KEYSTONE_PASS}" for option in auth_protocol auth_host auth_Port; do - crudini --del $cfg \ - keystone_authtoken \ - $option + crudini --del $cfg \ + keystone_authtoken \ + $option done crudini --set $cfg @@ -37,19 +37,18 @@ crudini --set $cfg crudini --set $cfg keystone_authtoken \ admin_tenant_name \ - "${ADMIN_TENANT_NAME}" + "${ADMIN_TENANT_NAME}" crudini --set $cfg keystone_authtoken \ admin_user \ - "${GLANCE_KEYSTONE_USER}" + "${GLANCE_KEYSTONE_USER}" crudini --set $cfg keystone_authtoken \ admin_password \ "${GLANCE_KEYSTONE_PASS}" crudini --set $cfg \ - database \ - connection \ - "mysql://${GLANCE_DB_USER}:${GLANCE_DB_PASSWORD}@${MARIADBMASTER_PORT_3306_TCP_ADDR}:${MARIADBMASTER_PORT_3306_TCP_PORT}/${GLANCE_DB_NAME}" - + database \ + connection \ + "mysql://${GLANCE_DB_USER}:${GLANCE_DB_PASSWORD}@${MARIADBMASTER_PORT_3306_TCP_ADDR}:${MARIADBMASTER_PORT_3306_TCP_PORT}/${GLANCE_DB_NAME}" diff --git a/docker/glance/glance-registry/start.sh b/docker/glance/glance-registry/start.sh index 4c362fc24e..4918e24540 100755 --- a/docker/glance/glance-registry/start.sh +++ b/docker/glance/glance-registry/start.sh @@ -4,37 +4,38 @@ : ${GLANCE_DB_NAME:=glance} : ${KEYSTONE_AUTH_PROTOCOL:=http} : ${GLANCE_KEYSTONE_USER:=glance} -: ${ADMIN_TENANT_NAME:=admin} +: ${GLANCE_TENANT_NAME:=services} if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then - echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2 - exit 1 + echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2 + exit 1 fi if ! [ "$DB_ROOT_PASSWORD" ]; then - echo "*** Missing DB_ROOT_PASSWORD" >&2 - exit 1 + echo "*** Missing DB_ROOT_PASSWORD" >&2 + exit 1 fi if ! [ "$GLANCE_DB_PASSWORD" ]; then - GLANCE_DB_PASSWORD=$(openssl rand -hex 15) - export GLANCE_DB_PASSWORD + GLANCE_DB_PASSWORD=$(openssl rand -hex 15) + export GLANCE_DB_PASSWORD fi sh /opt/glance/config-glance.sh registry -mysql -h ${MARIADBMASTER_PORT_3306_TCP_ADDR} -u root \ - -p${DB_ROOT_PASSWORD} mysql <