Gracefully add provider network port
Patch 5ec6f8f1 introduced the provider network support in DevStack. However, this patch
does not include a port clean up routine during ./unstack that openvswitch complains
that the PUBLIC_INTERFACE already exists and exits when you run DevStack multiple times.
Adding --may-exist to ovs add-port command solves this problem.
Change-Id: I89dc560ffb35fccf6ceed2557047adca37054ce7
diff --git a/lib/neutron b/lib/neutron
index b4d0b8c..90991d1 100755
--- a/lib/neutron
+++ b/lib/neutron
@@ -699,7 +699,7 @@
run_process q-dhcp "python $AGENT_DHCP_BINARY --config-file $NEUTRON_CONF --config-file=$Q_DHCP_CONF_FILE"
if is_provider_network; then
- sudo ovs-vsctl add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE
+ sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE
sudo ip link set $OVS_PHYSICAL_BRIDGE up
sudo ip link set br-int up
sudo ip link set $PUBLIC_INTERFACE up