Merge "[devstack] properly clean ZFS backend"

This commit is contained in:
Zuul 2019-01-25 23:56:30 +00:00 committed by Gerrit Code Review
commit 9daffc1279
1 changed files with 5 additions and 1 deletions

View File

@ -133,7 +133,11 @@ function shutdown_nova-lxd() {
function cleanup_nova-lxd() {
# Cleanup the service.
if [ "$LXD_BACKEND_DRIVER" == "zfs" ]; then
sudo zpool destroy ${LXD_ZFS_ZPOOL}
pool=`lxc profile device get default root pool 2>> /dev/null || :`
if [ "$pool" == "$LXD_ZFS_ZPOOL" ]; then
sudo lxc profile device remove default root
sudo lxc storage delete $LXD_ZFS_ZPOOL
fi
fi
}