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
This commit is contained in:
Dean Troyer
2013-03-07 16:11:40 -06:00
parent 08fd641a19
commit 995eb927f7
11 changed files with 185 additions and 10 deletions
+18
View File
@@ -10,6 +10,24 @@ set +o xtrace
register_database mysql
# Get rid of everything enough to cleanly change database backends
function cleanup_database_mysql {
if is_ubuntu; then
# Get ruthless with mysql
stop_service $MYSQL
sudo aptitude purge -y ~nmysql-server
sudo rm -rf /var/lib/mysql
return
elif is_fedora; then
MYSQL=mysqld
elif is_suse; then
MYSQL=mysql
else
return
fi
stop_service $MYSQL
}
function recreate_database_mysql {
local db=$1
local charset=$2
+14
View File
@@ -10,6 +10,20 @@ set +o xtrace
register_database postgresql
# Get rid of everything enough to cleanly change database backends
function cleanup_database_postgresql {
stop_service postgresql
if is_ubuntu; then
# Get ruthless with mysql
sudo aptitude purge -y ~npostgresql
return
elif is_fedora; then
uninstall_package postgresql-server
else
return
fi
}
function recreate_database_postgresql {
local db=$1
local charset=$2