From 0ddcae6baa01468eb8d23c1e418bc81a3ef307e0 Mon Sep 17 00:00:00 2001 From: Yong Sheng Gong Date: Tue, 20 Mar 2012 21:17:39 +0800 Subject: [PATCH] move glance conf dir to /etc/glance bug 959735 Change-Id: I0593790fda6c2f3c9af7a8c930234d21e4acf643 --- AUTHORS | 1 + stack.sh | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/AUTHORS b/AUTHORS index 073315fc04..86456159b6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -26,4 +26,5 @@ Todd Willey Tres Henry Vishvananda Ishaya Yun Mao +Yong Sheng Gong Zhongyue Luo diff --git a/stack.sh b/stack.sh index 9f88a0bde1..205567dc12 100755 --- a/stack.sh +++ b/stack.sh @@ -814,6 +814,11 @@ fi # ------ if is_service_enabled g-reg; then + GLANCE_CONF_DIR=/etc/glance + if [[ ! -d $GLANCE_CONF_DIR ]]; then + sudo mkdir -p $GLANCE_CONF_DIR + fi + sudo chown `whoami` $GLANCE_CONF_DIR GLANCE_IMAGE_DIR=$DEST/glance/images # Delete existing images rm -rf $GLANCE_IMAGE_DIR @@ -845,22 +850,22 @@ if is_service_enabled g-reg; then } # Copy over our glance configurations and update them - GLANCE_REGISTRY_CONF=$GLANCE_DIR/etc/glance-registry.conf + GLANCE_REGISTRY_CONF=$GLANCE_CONF_DIR/glance-registry.conf cp $FILES/glance-registry.conf $GLANCE_REGISTRY_CONF glance_config $GLANCE_REGISTRY_CONF if [[ -e $FILES/glance-registry-paste.ini ]]; then - GLANCE_REGISTRY_PASTE_INI=$GLANCE_DIR/etc/glance-registry-paste.ini + GLANCE_REGISTRY_PASTE_INI=$GLANCE_CONF_DIR/glance-registry-paste.ini cp $FILES/glance-registry-paste.ini $GLANCE_REGISTRY_PASTE_INI glance_config $GLANCE_REGISTRY_PASTE_INI fi - GLANCE_API_CONF=$GLANCE_DIR/etc/glance-api.conf + GLANCE_API_CONF=$GLANCE_CONF_DIR/glance-api.conf cp $FILES/glance-api.conf $GLANCE_API_CONF glance_config $GLANCE_API_CONF if [[ -e $FILES/glance-api-paste.ini ]]; then - GLANCE_API_PASTE_INI=$GLANCE_DIR/etc/glance-api-paste.ini + GLANCE_API_PASTE_INI=$GLANCE_CONF_DIR/glance-api-paste.ini cp $FILES/glance-api-paste.ini $GLANCE_API_PASTE_INI glance_config $GLANCE_API_PASTE_INI fi @@ -1426,12 +1431,12 @@ screen -r stack -X hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< # launch the glance registry service if is_service_enabled g-reg; then - screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=etc/glance-registry.conf" + screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf" fi # launch the glance api and wait for it to answer before continuing if is_service_enabled g-api; then - screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf" + screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=$GLANCE_CONF_DIR/glance-api.conf" echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..." if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://$GLANCE_HOSTPORT; do sleep 1; done"; then echo "g-api did not start"