Add clean.sh
clean.sh gets rid of all residue of running DevStack except installed
packages and pip modules.
And it eradicates rabbitmq-server and ts erlang dependencies as well as
the other RPC backends and databases.
Change-Id: I2b9a251a0a151c012bae85a5a2f9c2f72e7700be
diff --git a/lib/rpc_backend b/lib/rpc_backend
index 02614ea..bbd51f0 100644
--- a/lib/rpc_backend
+++ b/lib/rpc_backend
@@ -43,6 +43,38 @@
fi
}
+# clean up after rpc backend - eradicate all traces so changing backends
+# produces a clean switch
+function cleanup_rpc_backend {
+ if is_service_enabled rabbit; then
+ # Obliterate rabbitmq-server
+ uninstall_package rabbitmq-server
+ sudo killall epmd
+ if is_ubuntu; then
+ # And the Erlang runtime too
+ sudo aptitude purge -y ~nerlang
+ fi
+ elif is_service_enabled qpid; then
+ if is_fedora; then
+ uninstall_package qpid-cpp-server-daemon
+ elif is_ubuntu; then
+ uninstall_package qpidd
+ else
+ exit_distro_not_supported "qpid installation"
+ fi
+ elif is_service_enabled zeromq; then
+ if is_fedora; then
+ uninstall_package zeromq python-zmq
+ elif is_ubuntu; then
+ uninstall_package libzmq1 python-zmq
+ elif is_suse; then
+ uninstall_package libzmq1 python-pyzmq
+ else
+ exit_distro_not_supported "zeromq installation"
+ fi
+ fi
+}
+
# install rpc backend
function install_rpc_backend() {
if is_service_enabled rabbit; then