kolla/tools/cleanup-host
Steven Dake 77a67deeb6 Rename validate-docker-execute with .sh extension
TrivialFix

Change-Id: I3ad67fd802f7fe3ed7deb88eddebe520ff410a4f
2016-03-08 22:14:09 -07:00

29 lines
943 B
Bash
Executable File

#!/bin/bash
# Move to top level directory
REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
cd "$(dirname "$REAL_PATH")/.."
. tools/validate-docker-execute.sh
# Spawning the neutron-agents container leaves artifacts on the host.
# This script removes these artifacts.
ip netns list | while read -r line ; do
echo "Removing network namespace $line on the host"
ip netns delete $line
done
ifconfig | grep tap | awk '{print $1;}'| cut -f1 -d':' | while read -r line ; do
echo "Removing tap interface $line on the host"
ip link delete $line type veth
done
ifconfig | grep brq | awk '{print $1;}'| cut -f1 -d':' | while read -r line ; do
echo "Removing linux bridge $line on the host"
ip link delete $line type bridge
done
ifconfig | grep vxlan | awk '{print $1;}'| cut -f1 -d':' | while read -r line ; do
echo "Removing vxlan interface $line on the host"
ip link delete $line type vxlan
done