blob: 0b5b2d58a358b77ab8712975a6b8dabb5124739f [file] [log] [blame]
Gabe Black90623222017-01-18 19:52:28 +00001#!/bin/bash
2
3function cleanup_network {
4 NETWORK=$1
5 SUBNETS=`neutron net-show $NETWORK | grep -i subnets | awk '{print $4}'`
6 if [[ $SUBNETS != "" ]]; then
7 PORTS=`neutron port-list | grep -i $SUBNETS | awk '{print $2}'`
8 for PORT in $PORTS; do
9 echo "Deleting port $PORT"
10 neutron port-delete $PORT
11 done
12 fi
13 neutron net-delete $NETWORK
14}
15
16source ~/service-profile/cord-pod/admin-openrc.sh
17
18#cleanup_network lan_passivetest_private_network
19#cleanup_network public
20
21echo "Deleting networks"
22# Delete all networks beginning with mysite_
23NETS=$( neutron net-list --all-tenants|grep mysite|awk '{print $2}' )
24for NET in $NETS
25do
26 neutron net-delete $NET
27done
28
29#neutron net-delete lan_passivetest_private_network || true
30#neutron net-delete public || true