From 8c26f80481e349137239fb108d94a7b76469b7f5 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Mon, 10 Aug 2015 17:28:53 -0700 Subject: [PATCH] add --may-exist when adding port to a bridge When devstack is rerun repeatedly, port and bridges may have already existed, so when adding port to a bridge, add option to allow port to pre-exist in the bridge. Change-Id: Ib102075564c44e45035f3c05ddd909783bfe7f36 --- lib/neutron | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/neutron b/lib/neutron index ec4b416a1d..c5582878b4 100644 --- a/lib/neutron +++ b/lib/neutron @@ -507,7 +507,7 @@ function create_neutron_initial_network { if [[ "$PUBLIC_INTERFACE" == '' || "$OVS_PHYSICAL_BRIDGE" == '' ]]; then die $LINENO "Neutron settings for baremetal not set.. exiting" fi - sudo ovs-vsctl add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE + sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE for IP in $(ip addr show dev $PUBLIC_INTERFACE | grep ' inet ' | awk '{print $2}'); do sudo ip addr del $IP dev $PUBLIC_INTERFACE sudo ip addr add $IP dev $OVS_PHYSICAL_BRIDGE @@ -655,7 +655,7 @@ function start_neutron_agents { 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