-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsnap-destroy
More file actions
executable file
·38 lines (30 loc) · 1.2 KB
/
snap-destroy
File metadata and controls
executable file
·38 lines (30 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -x
# Manually define aliases if snap isn't installed from snap store.
# Otherwise, snap store defines these aliases automatically.
snap aliases nova-hypervisor | grep neutron-ovs-cleanup || \
sudo snap alias nova-hypervisor.neutron-ovs-cleanup neutron-ovs-cleanup
snap aliases nova-hypervisor | grep neutron-netns-cleanup || \
sudo snap alias nova-hypervisor.neutron-netns-cleanup neutron-netns-cleanup
sudo neutron-ovs-cleanup
sudo neutron-netns-cleanup
snaps="database keystone nova neutron glance cinder nova-hypervisor neutron-ext-net"
for snap in $snaps; do
sudo snap remove $snap
done
sudo mysql -u root << EOF
DROP DATABASE keystone;
DROP DATABASE nova;
DROP DATABASE nova_api;
DROP DATABASE nova_cell0;
DROP DATABASE neutron;
DROP DATABASE glance;
DROP DATABASE cinder;
EOF
sudo rabbitmqctl delete_user openstack
# Clean up the cinder volume group and file-based loopback device
sudo lvremove -f cinder-volumes
sudo vgremove -f cinder-volumes
loop_dev=$(sudo losetup -j /var/cinder/cinder-volumes-file | awk -F':' '/'cinder-volumes-file'/ { print $1}')
[ -n $loop_dev ] || sudo losetup -d $loop_dev
[ -e /var/cinder/cinder-volumes-file ] && sudo rm /var/cinder/cinder-volumes-file