Ceph: undefine secret from nova.conf when deleting secret

At teardown time we delete the libvirt secret but leave
nova.conf referencing the stale UUID.  Remove it to make
debugging and repeated runs less error-prone.

Additionally, only try to delete secret if it Cinder is
enabled (causing it to be defined when deploying devstack).

Change-Id: Id5e1290b8dcfd79238f02e31084ab12c3d6aed5f
This commit is contained in:
Eric Harney 2014-10-01 13:20:50 -04:00
parent 2d7f196277
commit b01fb940c9

View File

@ -106,8 +106,13 @@ function cleanup_ceph {
sudo rm -f ${CEPH_DISK_IMAGE}
fi
uninstall_package ceph ceph-common python-ceph libcephfs1 > /dev/null 2>&1
VIRSH_UUID=$(sudo virsh secret-list | awk '/^ ?[0-9a-z]/ { print $1 }')
sudo virsh secret-undefine ${VIRSH_UUID} >/dev/null 2>&1
if is_service_enabled cinder || is_service_enabled nova; then
local virsh_uuid=$(sudo virsh secret-list | awk '/^ ?[0-9a-z]/ { print $1 }')
sudo virsh secret-undefine ${virsh_uuid} >/dev/null 2>&1
fi
if is_service_enabled nova; then
iniset $NOVA_CONF libvirt rbd_secret_uuid ""
fi
}
# configure_ceph() - Set config files, create data dirs, etc