From 5c0546e427a02ca7f84eac0894bc84073fa32638 Mon Sep 17 00:00:00 2001 From: Hirofumi Ichihara Date: Fri, 26 Jun 2015 17:43:28 +0900 Subject: [PATCH] Add cleanup for Linuxbridge-agent Change-Id: I53f445e7f8efd950823f79aca95b9e65d1544ee9 Closes-Bug: #1469609 --- lib/neutron_plugins/linuxbridge_agent | 14 ++++++++++++++ 1 file changed, 14 insertions(+) mode change 100644 => 100755 lib/neutron_plugins/linuxbridge_agent diff --git a/lib/neutron_plugins/linuxbridge_agent b/lib/neutron_plugins/linuxbridge_agent old mode 100644 new mode 100755 index b348af9c4f..fefc1c33a8 --- a/lib/neutron_plugins/linuxbridge_agent +++ b/lib/neutron_plugins/linuxbridge_agent @@ -9,6 +9,20 @@ set +o xtrace function neutron_lb_cleanup { sudo brctl delbr $PUBLIC_BRIDGE + + if [[ "$Q_ML2_TENANT_NETWORK_TYPE" = "vxlan" ]]; then + for port in $(sudo brctl show | grep -o -e [a-zA-Z\-]*tap[0-9a-f\-]* -e vxlan-[0-9a-f\-]*); do + sudo ip link delete $port + done + elif [[ "$Q_ML2_TENANT_NETWORK_TYPE" = "vlan" ]]; then + for port in $(sudo brctl show | grep -o -e [a-zA-Z\-]*tap[0-9a-f\-]* -e ${LB_PHYSICAL_INTERFACE}\.[0-9a-f\-]*); do + sudo ip link delete $port + done + fi + for bridge in $(sudo brctl show |grep -o -e brq[0-9a-f\-]*); do + sudo ip link set $bridge down + sudo brctl delbr $bridge + done } function is_neutron_ovs_base_plugin {