File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -406,7 +406,14 @@ function stop_quantum() {
406406# cleanup_quantum() - Remove residual data files, anything left over from previous
407407# runs that a clean run would need to clean up
408408function cleanup_quantum() {
409- :
409+ if is_quantum_ovs_base_plugin; then
410+ quantum_ovs_base_cleanup
411+ fi
412+
413+ # delete all namespaces created by quantum
414+ for ns in $(sudo ip netns list | grep -o -e qdhcp-[0-9a-f\-]* -e qrouter-[0-9a-f\-]*); do
415+ sudo ip netns delete ${ns}
416+ done
410417}
411418
412419# _configure_quantum_common()
@@ -502,7 +509,6 @@ function _configure_quantum_l3_agent() {
502509 # for l3-agent, only use per tenant router if we have namespaces
503510 Q_L3_ROUTER_PER_TENANT=$Q_USE_NAMESPACE
504511 AGENT_L3_BINARY="$QUANTUM_DIR/bin/quantum-l3-agent"
505- PUBLIC_BRIDGE=${PUBLIC_BRIDGE:-br-ex}
506512 Q_L3_CONF_FILE=$QUANTUM_CONF_DIR/l3_agent.ini
507513
508514 cp $QUANTUM_DIR/etc/l3_agent.ini $Q_L3_CONF_FILE
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ OFC_DRIVER=${OFC_DRIVER:-trema}
1717OFC_RETRY_MAX=${OFC_RETRY_MAX:-0}
1818OFC_RETRY_INTERVAL=${OFC_RETRY_INTERVAL:-1}
1919
20- OVS_BRIDGE=${OVS_BRIDGE:-br-int}
21-
2220# Main logic
2321# ---------------------------
2422
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ set +o xtrace
88source $TOP_DIR/lib/quantum_plugins/ovs_base
99
1010function setup_integration_bridge() {
11- OVS_BRIDGE=${OVS_BRIDGE:-br-int}
1211 _quantum_ovs_base_setup_bridge $OVS_BRIDGE
1312 # Set manager to NVP controller (1st of list)
1413 if [[ "$NVP_CONTROLLERS" != "" ]]; then
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ function quantum_plugin_configure_l3_agent() {
4141
4242function quantum_plugin_configure_plugin_agent() {
4343 # Setup integration bridge
44- OVS_BRIDGE=${OVS_BRIDGE:-br-int}
4544 _quantum_ovs_base_setup_bridge $OVS_BRIDGE
4645 _quantum_ovs_base_configure_firewall_driver
4746
Original file line number Diff line number Diff line change 55MY_XTRACE=$(set +o | grep xtrace)
66set +o xtrace
77
8+ OVS_BRIDGE=${OVS_BRIDGE:-br-int}
9+ PUBLIC_BRIDGE=${PUBLIC_BRIDGE:-br-ex}
10+
811function is_quantum_ovs_base_plugin() {
912 # Yes, we use OVS.
1013 return 0
@@ -17,6 +20,18 @@ function _quantum_ovs_base_setup_bridge() {
1720 sudo ovs-vsctl --no-wait br-set-external-id $bridge bridge-id $bridge
1821}
1922
23+ function quantum_ovs_base_cleanup() {
24+ # remove all OVS ports that look like Quantum created ports
25+ for port in $(sudo ovs-vsctl list port | grep -o -e tap[0-9a-f\-]* -e q[rg]-[0-9a-f\-]*); do
26+ sudo ovs-vsctl del-port ${port}
27+ done
28+
29+ # remove all OVS bridges created by Quantum
30+ for bridge in $(sudo ovs-vsctl list-br | grep -o -e ${OVS_BRIDGE} -e ${PUBLIC_BRIDGE}); do
31+ sudo ovs-vsctl del-br ${bridge}
32+ done
33+ }
34+
2035function _quantum_ovs_base_install_agent_packages() {
2136 local kernel_version
2237 # Install deps
Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ function quantum_plugin_configure_l3_agent() {
4545
4646function quantum_plugin_configure_plugin_agent() {
4747 # Set up integration bridge
48- OVS_BRIDGE=${OVS_BRIDGE:-br-int}
4948 _quantum_ovs_base_setup_bridge $OVS_BRIDGE
5049 if [ -n "$RYU_INTERNAL_INTERFACE" ]; then
5150 sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $RYU_INTERNAL_INTERFACE
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ set +o xtrace
77
88BS_FL_CONTROLLERS_PORT=${BS_FL_CONTROLLERS_PORT:-localhost:80}
99BS_FL_OF_PORT=${BS_FL_OF_PORT:-6633}
10- OVS_BRIDGE=${OVS_BRIDGE:-br-int}
1110
1211function configure_bigswitch_floodlight() {
1312 :
Original file line number Diff line number Diff line change 109109if is_service_enabled quantum; then
110110 stop_quantum
111111 stop_quantum_third_party
112+ cleanup_quantum
112113fi
You can’t perform that action at this time.
0 commit comments