clean.sh updates

* Clean out data, log and state dirs
* Include lib/apache to clear is_apache_enabled_service not found error
* Clean errors removing tgt config files

* Clean errors removing VG backing file in lib/cinder

Change-Id: I33dfde17eb8daaaed7f7e76337fe6a8085a266bf
This commit is contained in:
Dean Troyer 2013-12-17 11:13:40 -06:00
parent 19bff77d20
commit 53ffc713b1
2 changed files with 18 additions and 12 deletions

View File

@ -30,13 +30,17 @@ fi
# and ``DISTRO``
GetDistro
# Import apache functions
source $TOP_DIR/lib/apache
source $TOP_DIR/lib/ldap
# Import database library
source $TOP_DIR/lib/database
source $TOP_DIR/lib/rpc_backend
source $TOP_DIR/lib/oslo
source $TOP_DIR/lib/tls
source $TOP_DIR/lib/oslo
source $TOP_DIR/lib/horizon
source $TOP_DIR/lib/keystone
source $TOP_DIR/lib/glance
@ -47,7 +51,9 @@ source $TOP_DIR/lib/ceilometer
source $TOP_DIR/lib/heat
source $TOP_DIR/lib/neutron
source $TOP_DIR/lib/baremetal
source $TOP_DIR/lib/ldap
source $TOP_DIR/lib/ironic
source $TOP_DIR/lib/trove
# Extras Source
# --------------
@ -95,13 +101,6 @@ if [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then
cleanup_nova_hypervisor
fi
# cinder doesn't always clean up the volume group as it might be used elsewhere...
# clean it up if it is a loop device
VG_DEV=$(sudo losetup -j $DATA_DIR/${VOLUME_GROUP}-backing-file | awk -F':' '/backing-file/ { print $1}')
if [[ -n "$VG_DEV" ]]; then
sudo losetup -d $VG_DEV
fi
#if mount | grep $DATA_DIR/swift/drives; then
# sudo umount $DATA_DIR/swift/drives/sdb1
#fi
@ -111,12 +110,19 @@ fi
sudo rm -rf /etc/keystone /etc/glance /etc/nova /etc/cinder /etc/swift
# Clean out tgt
sudo rm /etc/tgt/conf.d/*
sudo rm -f /etc/tgt/conf.d/*
# Clean up the message queue
cleanup_rpc_backend
cleanup_database
# Clean out data, logs and status
LOGDIR=$(dirname "$LOGFILE")
sudo rm -rf $DATA_DIR $LOGDIR $DEST/status
if [[ -n "$SCREEN_LOGDIR" ]] && [[ -d "$SCREEN_LOGDIR" ]]; then
sudo rm -rf $SCREEN_LOGDIR
fi
# Clean up networking...
# should this be in nova?
# FIXED_IP_ADDR in br100

View File

@ -109,8 +109,8 @@ function _clean_lvm_backing_file() {
# of the backing file
if [ -z "`sudo lvs --noheadings -o lv_name $vg`" ]; then
# if the backing physical device is a loop device, it was probably setup by devstack
VG_DEV=$(sudo losetup -j $DATA_DIR/${vg}-backing-file | awk -F':' '/backing-file/ { print $1}')
if [[ -n "$VG_DEV" ]]; then
if [[ -n "$VG_DEV" ]] && [[ -e "$VG_DEV" ]]; then
VG_DEV=$(sudo losetup -j $DATA_DIR/${vg}-backing-file | awk -F':' '/backing-file/ { print $1}')
sudo losetup -d $VG_DEV
rm -f $DATA_DIR/${vg}-backing-file
fi