| #!/bin/bash |
| |
| function cleanup_network { |
| NETWORK=$1 |
| SUBNETS=`neutron net-show $NETWORK | grep -i subnets | awk '{print $4}'` |
| if [[ $SUBNETS != "" ]]; then |
| PORTS=`neutron port-list | grep -i $SUBNETS | awk '{print $2}'` |
| for PORT in $PORTS; do |
| echo "Deleting port $PORT" |
| neutron port-delete $PORT |
| done |
| fi |
| neutron net-delete $NETWORK |
| } |
| |
| source ~/service-profile/cord-pod/admin-openrc.sh |
| |
| #cleanup_network lan_passivetest_private_network |
| #cleanup_network public |
| |
| echo "Deleting networks" |
| # Delete all networks beginning with mysite_ |
| NETS=$( neutron net-list --all-tenants|grep mysite|awk '{print $2}' ) |
| for NET in $NETS |
| do |
| neutron net-delete $NET |
| done |
| |
| #neutron net-delete lan_passivetest_private_network || true |
| #neutron net-delete public || true |