Merge "Replace deprecated brctl with ip commands"

This commit is contained in:
Zuul 2019-03-12 22:22:05 +00:00 committed by Gerrit Code Review
commit e86a6aa924
3 changed files with 11 additions and 18 deletions

View File

@ -369,17 +369,6 @@ To pull glance, OpenStack Image service, from an experimental fork:
Notes stuff you might need to know Notes stuff you might need to know
================================== ==================================
Reset the Bridge
----------------
How to reset the bridge configuration:
::
sudo brctl delif br100 eth0.926
sudo ip link set dev br100 down
sudo brctl delbr br100
Set MySQL Password Set MySQL Password
------------------ ------------------

View File

@ -8,21 +8,23 @@ _XTRACE_NEUTRON_LB=$(set +o | grep xtrace)
set +o xtrace set +o xtrace
function neutron_lb_cleanup { function neutron_lb_cleanup {
sudo ip link set $PUBLIC_BRIDGE down sudo ip link delete $PUBLIC_BRIDGE
sudo brctl delbr $PUBLIC_BRIDGE
bridge_list=`ls /sys/class/net/*/bridge/bridge_id 2>/dev/null | cut -f5 -d/`
if [[ -z "$bridge_list" ]]; then
return
fi
if [[ "$Q_ML2_TENANT_NETWORK_TYPE" = "vxlan" ]]; then 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 for port in $(echo $bridge_list | grep -o -e [a-zA-Z\-]*tap[0-9a-f\-]* -e vxlan-[0-9a-f\-]*); do
sudo ip link delete $port sudo ip link delete $port
done done
elif [[ "$Q_ML2_TENANT_NETWORK_TYPE" = "vlan" ]]; then 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 for port in $(echo $bridge_list | grep -o -e [a-zA-Z\-]*tap[0-9a-f\-]* -e ${LB_PHYSICAL_INTERFACE}\.[0-9a-f\-]*); do
sudo ip link delete $port sudo ip link delete $port
done done
fi fi
for bridge in $(sudo brctl show |grep -o -e brq[0-9a-f\-]*); do for bridge in $(echo $bridge_list |grep -o -e brq[0-9a-f\-]*); do
sudo ip link set $bridge down sudo ip link delete $bridge
sudo brctl delbr $bridge
done done
} }

View File

@ -163,7 +163,9 @@ def _netns_list():
def network_dump(): def network_dump():
_header("Network Dump") _header("Network Dump")
_dump_cmd("bridge link")
_dump_cmd("brctl show") _dump_cmd("brctl show")
_dump_cmd("ip link show type bridge")
ip_cmds = ["neigh", "addr", "link", "route"] ip_cmds = ["neigh", "addr", "link", "route"]
for cmd in ip_cmds + ['netns']: for cmd in ip_cmds + ['netns']:
_dump_cmd("ip %s" % cmd) _dump_cmd("ip %s" % cmd)