move glance conf dir to /etc/glance

bug 959735

Change-Id: I0593790fda6c2f3c9af7a8c930234d21e4acf643
This commit is contained in:
Yong Sheng Gong 2012-03-20 21:17:39 +08:00
parent bd07d61c45
commit 0ddcae6baa
2 changed files with 12 additions and 6 deletions

View File

@ -26,4 +26,5 @@ Todd Willey <xtoddx@gmail.com>
Tres Henry <tres@treshenry.net> Tres Henry <tres@treshenry.net>
Vishvananda Ishaya <vishvananda@gmail.com> Vishvananda Ishaya <vishvananda@gmail.com>
Yun Mao <yunmao@gmail.com> Yun Mao <yunmao@gmail.com>
Yong Sheng Gong <gongysh@cn.ibm.com>
Zhongyue Luo <lzyeval@gmail.com> Zhongyue Luo <lzyeval@gmail.com>

View File

@ -814,6 +814,11 @@ fi
# ------ # ------
if is_service_enabled g-reg; then 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 GLANCE_IMAGE_DIR=$DEST/glance/images
# Delete existing images # Delete existing images
rm -rf $GLANCE_IMAGE_DIR rm -rf $GLANCE_IMAGE_DIR
@ -845,22 +850,22 @@ if is_service_enabled g-reg; then
} }
# Copy over our glance configurations and update them # 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 cp $FILES/glance-registry.conf $GLANCE_REGISTRY_CONF
glance_config $GLANCE_REGISTRY_CONF glance_config $GLANCE_REGISTRY_CONF
if [[ -e $FILES/glance-registry-paste.ini ]]; then 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 cp $FILES/glance-registry-paste.ini $GLANCE_REGISTRY_PASTE_INI
glance_config $GLANCE_REGISTRY_PASTE_INI glance_config $GLANCE_REGISTRY_PASTE_INI
fi 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 cp $FILES/glance-api.conf $GLANCE_API_CONF
glance_config $GLANCE_API_CONF glance_config $GLANCE_API_CONF
if [[ -e $FILES/glance-api-paste.ini ]]; then 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 cp $FILES/glance-api-paste.ini $GLANCE_API_PASTE_INI
glance_config $GLANCE_API_PASTE_INI glance_config $GLANCE_API_PASTE_INI
fi fi
@ -1426,12 +1431,12 @@ screen -r stack -X hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<
# launch the glance registry service # launch the glance registry service
if is_service_enabled g-reg; then 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 fi
# launch the glance api and wait for it to answer before continuing # launch the glance api and wait for it to answer before continuing
if is_service_enabled g-api; then 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..." 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 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" echo "g-api did not start"