From 77cdac6a0db18e5fd2ff8e346937dac9d7a4a572 Mon Sep 17 00:00:00 2001 From: leejian0612 Date: Tue, 18 Aug 2015 15:57:59 +0800 Subject: [PATCH] Add --may-exist to l3_agent recipe when external_network_bridge is not empty, and has been created in formal deployment operation, at this time the external_network_interface should has been added to the external_network_bridge, so if we run a update operation on l3 agent recipe, it will try to add the interface to the bridge again, that will return an error, add --may-exist to avoid it. Change-Id: I40dabc862ae12dc4be81b196987b692a34c0c6c9 Partial-Bug: 1483994 --- recipes/l3_agent.rb | 2 +- spec/l3_agent_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/l3_agent.rb b/recipes/l3_agent.rb index befa2143..714e957a 100644 --- a/recipes/l3_agent.rb +++ b/recipes/l3_agent.rb @@ -127,7 +127,7 @@ when 'OVSInterfaceDriver' not_if "ovs-vsctl br-exists #{ext_bridge}" end execute 'enable external_network_bridge_interface' do - command "ip link set #{ext_bridge_iface} up && ovs-vsctl add-port #{ext_bridge} #{ext_bridge_iface}" + command "ip link set #{ext_bridge_iface} up && ovs-vsctl --may-exist add-port #{ext_bridge} #{ext_bridge_iface}" only_if "ip link show #{ext_bridge_iface}" end end diff --git a/spec/l3_agent_spec.rb b/spec/l3_agent_spec.rb index b0317d94..44efba66 100644 --- a/spec/l3_agent_spec.rb +++ b/spec/l3_agent_spec.rb @@ -168,7 +168,7 @@ describe 'openstack-network::l3_agent' do describe 'create ovs bridges' do let(:cmd) { 'ovs-vsctl add-br br-ex' } - let(:iplink) { 'ip link set eth1 up && ovs-vsctl add-port br-ex eth1' } + let(:iplink) { 'ip link set eth1 up && ovs-vsctl --may-exist add-port br-ex eth1' } it 'does not add the external bridge and disable external_network_bridge_interface if external_network_bridge is empty' do node.set['openstack']['network']['l3']['external_network_bridge'] = ''