Cinder: On SUSE, avoid restarting tgt
There is a known bug that restart tgtd fails, so go the
workaround way and stopping/starting it instead.
In addition, remove the else case since unstack also
uses cleanup_cinder, which already unconditionally supports
all distros.
Change-Id: Ib70917a95f001ef36a51815f08416fa30084aad6
diff --git a/lib/cinder b/lib/cinder
index b8cf809..ade3b82 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -432,12 +432,13 @@
_configure_tgt_for_config_d
if is_ubuntu; then
sudo service tgt restart
- elif is_fedora || is_suse; then
- restart_service tgtd
+ elif is_suse; then
+ # NOTE(dmllr): workaround restart bug
+ # https://bugzilla.suse.com/show_bug.cgi?id=934642
+ stop_service tgtd
+ start_service tgtd
else
- # note for other distros: unstack.sh also uses the tgt/tgtd service
- # name, and would need to be adjusted too
- exit_distro_not_supported "restarting tgt"
+ restart_service tgtd
fi
# NOTE(gfidente): ensure tgtd is running in debug mode
sudo tgtadm --mode system --op update --name debug --value on