blob: c31c12a325cea010d6cadcfa8295b9d8d820d50a [file] [log] [blame]
#!/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/admin-openrc.sh
cleanup_network lan_activetest_test_network1
cleanup_network lan_activetest_public_network
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_activetest_test_network1 || true
neutron net-delete lan_activetest_public_network || true