Browse code

move glance conf dir to /etc/glance

bug 959735

Change-Id: I0593790fda6c2f3c9af7a8c930234d21e4acf643

Yong Sheng Gong authored on 2012/03/20 22:17:39
Showing 2 changed files
... ...
@@ -26,4 +26,5 @@ Todd Willey <xtoddx@gmail.com>
26 26
 Tres Henry <tres@treshenry.net>
27 27
 Vishvananda Ishaya <vishvananda@gmail.com>
28 28
 Yun Mao <yunmao@gmail.com>
29
+Yong Sheng Gong <gongysh@cn.ibm.com>
29 30
 Zhongyue Luo <lzyeval@gmail.com>
... ...
@@ -814,6 +814,11 @@ fi
814 814
 # ------
815 815
 
816 816
 if is_service_enabled g-reg; then
817
+    GLANCE_CONF_DIR=/etc/glance
818
+    if [[ ! -d $GLANCE_CONF_DIR ]]; then
819
+        sudo mkdir -p $GLANCE_CONF_DIR
820
+    fi
821
+    sudo chown `whoami` $GLANCE_CONF_DIR
817 822
     GLANCE_IMAGE_DIR=$DEST/glance/images
818 823
     # Delete existing images
819 824
     rm -rf $GLANCE_IMAGE_DIR
... ...
@@ -845,22 +850,22 @@ if is_service_enabled g-reg; then
845 845
     }
846 846
 
847 847
     # Copy over our glance configurations and update them
848
-    GLANCE_REGISTRY_CONF=$GLANCE_DIR/etc/glance-registry.conf
848
+    GLANCE_REGISTRY_CONF=$GLANCE_CONF_DIR/glance-registry.conf
849 849
     cp $FILES/glance-registry.conf $GLANCE_REGISTRY_CONF
850 850
     glance_config $GLANCE_REGISTRY_CONF
851 851
 
852 852
     if [[ -e $FILES/glance-registry-paste.ini ]]; then
853
-        GLANCE_REGISTRY_PASTE_INI=$GLANCE_DIR/etc/glance-registry-paste.ini
853
+        GLANCE_REGISTRY_PASTE_INI=$GLANCE_CONF_DIR/glance-registry-paste.ini
854 854
         cp $FILES/glance-registry-paste.ini $GLANCE_REGISTRY_PASTE_INI
855 855
         glance_config $GLANCE_REGISTRY_PASTE_INI
856 856
     fi
857 857
 
858
-    GLANCE_API_CONF=$GLANCE_DIR/etc/glance-api.conf
858
+    GLANCE_API_CONF=$GLANCE_CONF_DIR/glance-api.conf
859 859
     cp $FILES/glance-api.conf $GLANCE_API_CONF
860 860
     glance_config $GLANCE_API_CONF
861 861
 
862 862
     if [[ -e $FILES/glance-api-paste.ini ]]; then
863
-        GLANCE_API_PASTE_INI=$GLANCE_DIR/etc/glance-api-paste.ini
863
+        GLANCE_API_PASTE_INI=$GLANCE_CONF_DIR/glance-api-paste.ini
864 864
         cp $FILES/glance-api-paste.ini $GLANCE_API_PASTE_INI
865 865
         glance_config $GLANCE_API_PASTE_INI
866 866
     fi
... ...
@@ -1426,12 +1431,12 @@ screen -r stack -X hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<
1426 1426
 
1427 1427
 # launch the glance registry service
1428 1428
 if is_service_enabled g-reg; then
1429
-    screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=etc/glance-registry.conf"
1429
+    screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf"
1430 1430
 fi
1431 1431
 
1432 1432
 # launch the glance api and wait for it to answer before continuing
1433 1433
 if is_service_enabled g-api; then
1434
-    screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf"
1434
+    screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=$GLANCE_CONF_DIR/glance-api.conf"
1435 1435
     echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..."
1436 1436
     if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://$GLANCE_HOSTPORT; do sleep 1; done"; then
1437 1437
       echo "g-api did not start"