Browse code

Merge "link /etc/tgt/stack.d to cinder volumes directory"

Jenkins authored on 2013/04/15 22:20:28
Showing 1 changed files
... ...
@@ -377,21 +377,20 @@ function install_cinderclient() {
377 377
     setup_develop $CINDERCLIENT_DIR
378 378
 }
379 379
 
380
-# apply config.d approach (e.g. Oneiric does not have this)
380
+# apply config.d approach for cinder volumes directory
381 381
 function _configure_tgt_for_config_d() {
382
-    if [[ ! -d /etc/tgt/conf.d/ ]]; then
383
-        sudo mkdir -p /etc/tgt/conf.d
384
-        echo "include /etc/tgt/conf.d/*.conf" | sudo tee -a /etc/tgt/targets.conf
382
+    if [[ ! -d /etc/tgt/stack.d/ ]]; then
383
+        sudo ln -sf $CINDER_STATE_PATH/volumes /etc/tgt/stack.d
384
+        echo "include /etc/tgt/stack.d/*" | sudo tee -a /etc/tgt/targets.conf
385 385
     fi
386 386
 }
387 387
 
388 388
 # start_cinder() - Start running processes, including screen
389 389
 function start_cinder() {
390 390
     if is_service_enabled c-vol; then
391
+        # Delete any old stack.conf
392
+        sudo rm -f /etc/tgt/conf.d/stack.conf
391 393
         _configure_tgt_for_config_d
392
-        if [[ ! -f /etc/tgt/conf.d/stack.conf ]]; then
393
-            echo "include $CINDER_STATE_PATH/volumes/*" | sudo tee /etc/tgt/conf.d/stack.conf
394
-        fi
395 394
         if is_ubuntu; then
396 395
             # tgt in oneiric doesn't restart properly if tgtd isn't running
397 396
             # do it in two steps