Browse code

lib/cinder:configure tgt even if the package was purged

On Ubuntu, after a successful ./stack.sh and ./unstack.sh, if one
"apt-get purge tgt", then the directory /etc/tgt/stack.d/ still
exist (i.e it is not purged) but /etc/tgt/targets.conf is removed.
Thus any subsequent ./stack.sh would fail to configure
/etc/tgt/targets.conf properly.

Change-Id: I252789f3f39bd64b5a1e7d9abb923386d2a158dd

Jordan Pittier authored on 2016/01/08 03:40:44
Showing 1 changed files
... ...
@@ -467,6 +467,8 @@ function install_cinderclient {
467 467
 function _configure_tgt_for_config_d {
468 468
     if [[ ! -d /etc/tgt/stack.d/ ]]; then
469 469
         sudo ln -sf $CINDER_STATE_PATH/volumes /etc/tgt/stack.d
470
+    fi
471
+    if ! grep -q "include /etc/tgt/stack.d/*" /etc/tgt/targets.conf; then
470 472
         echo "include /etc/tgt/stack.d/*" | sudo tee -a /etc/tgt/targets.conf
471 473
     fi
472 474
 }