Gabe Black | 9062322 | 2017-01-18 19:52:28 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | function 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 | |
| 16 | source ~/service-profile/cord-pod/admin-openrc.sh |
| 17 | |
| 18 | #cleanup_network lan_passivetest_private_network |
| 19 | #cleanup_network public |
| 20 | |
| 21 | echo "Deleting networks" |
| 22 | # Delete all networks beginning with mysite_ |
| 23 | NETS=$( neutron net-list --all-tenants|grep mysite|awk '{print $2}' ) |
| 24 | for NET in $NETS |
| 25 | do |
| 26 | neutron net-delete $NET |
| 27 | done |
| 28 | |
| 29 | #neutron net-delete lan_passivetest_private_network || true |
| 30 | #neutron net-delete public || true |