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
This commit is contained in:
Jordan Pittier 2016-01-07 19:40:44 +01:00
parent a5ea08b752
commit a263e7dd52

View File

@ -467,6 +467,8 @@ function install_cinderclient {
function _configure_tgt_for_config_d {
if [[ ! -d /etc/tgt/stack.d/ ]]; then
sudo ln -sf $CINDER_STATE_PATH/volumes /etc/tgt/stack.d
fi
if ! grep -q "include /etc/tgt/stack.d/*" /etc/tgt/targets.conf; then
echo "include /etc/tgt/stack.d/*" | sudo tee -a /etc/tgt/targets.conf
fi
}