Browse code

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

Eric Harney authored on 2014/10/02 02:20:50
Showing 1 changed files
... ...
@@ -106,8 +106,13 @@ function cleanup_ceph {
106 106
         sudo rm -f ${CEPH_DISK_IMAGE}
107 107
     fi
108 108
     uninstall_package ceph ceph-common python-ceph libcephfs1 > /dev/null 2>&1
109
-    VIRSH_UUID=$(sudo virsh secret-list | awk '/^ ?[0-9a-z]/ { print $1 }')
110
-    sudo virsh secret-undefine ${VIRSH_UUID} >/dev/null 2>&1
109
+    if is_service_enabled cinder || is_service_enabled nova; then
110
+        local virsh_uuid=$(sudo virsh secret-list | awk '/^ ?[0-9a-z]/ { print $1 }')
111
+        sudo virsh secret-undefine ${virsh_uuid} >/dev/null 2>&1
112
+    fi
113
+    if is_service_enabled nova; then
114
+        iniset $NOVA_CONF libvirt rbd_secret_uuid ""
115
+    fi
111 116
 }
112 117
 
113 118
 # configure_ceph() - Set config files, create data dirs, etc