Removed the route provider as an IP address is required.
As an alternative, I opted to use an execute and call ip link directly. This should enable the interface before the execute to create the ovs-bridge. Closes-Bug: 1396908 Change-Id: Ia2978c44da66c145308dfccf4d99db91e207e917
This commit is contained in:
parent
a28146eda4
commit
7cd726f527
|
@ -18,6 +18,7 @@ This file is used to list changes made in each version of cookbook-openstack-net
|
|||
* Enable services required by vpn drivers
|
||||
* Set the external physical interface to up
|
||||
* Fix an error from restarting the metadata agent before installing the package.
|
||||
* Remove route lwrp in favor of standard exec to set external physical interface to up (only for OVS)
|
||||
|
||||
## 10.0.1
|
||||
* Add tunnel_types item in ovs_neutron_plugin.ini.erb
|
||||
|
|
|
@ -79,16 +79,15 @@ template '/etc/neutron/l3_agent.ini' do
|
|||
end
|
||||
end
|
||||
|
||||
route 'enable external_network_bridge_interface' do
|
||||
device node['openstack']['network']['l3']['external_network_bridge_interface']
|
||||
end
|
||||
|
||||
driver_name = node['openstack']['network']['interface_driver'].split('.').last
|
||||
# See http://docs.openstack.org/admin-guide-cloud/content/section_adv_cfg_l3_agent.html
|
||||
case driver_name
|
||||
when 'OVSInterfaceDriver'
|
||||
ext_bridge = node['openstack']['network']['l3']['external_network_bridge']
|
||||
ext_bridge_iface = node['openstack']['network']['l3']['external_network_bridge_interface']
|
||||
execute 'enable external_network_bridge_interface' do
|
||||
command "ip link set #{ext_bridge_iface} up"
|
||||
end
|
||||
execute 'create external network bridge' do
|
||||
command "ovs-vsctl add-br #{ext_bridge} && ovs-vsctl add-port #{ext_bridge} #{ext_bridge_iface}"
|
||||
action :run
|
||||
|
|
|
@ -51,10 +51,6 @@ describe 'openstack-network::l3_agent' do
|
|||
end
|
||||
end
|
||||
|
||||
it 'should enable the external physical interface' do
|
||||
expect(chef_run).to add_route('enable external_network_bridge_interface').with(device: 'eth1')
|
||||
end
|
||||
|
||||
describe 'l3_agent.ini' do
|
||||
let(:file) { chef_run.template('/etc/neutron/l3_agent.ini') }
|
||||
|
||||
|
@ -102,12 +98,14 @@ describe 'openstack-network::l3_agent' do
|
|||
end
|
||||
|
||||
describe 'create ovs bridges' do
|
||||
let(:iplink) { 'ip link set eth1 up' }
|
||||
let(:cmd) { 'ovs-vsctl add-br br-ex && ovs-vsctl add-port br-ex eth1' }
|
||||
|
||||
it "doesn't add the external bridge if it already exists" do
|
||||
stub_command(/ovs-vsctl br-exists/).and_return(true)
|
||||
stub_command(/ip link show eth1/).and_return(true)
|
||||
|
||||
expect(chef_run).to run_execute(iplink)
|
||||
expect(chef_run).not_to run_execute(cmd)
|
||||
end
|
||||
|
||||
|
@ -115,6 +113,7 @@ describe 'openstack-network::l3_agent' do
|
|||
stub_command(/ovs-vsctl br-exists/).and_return(true)
|
||||
stub_command(/ip link show eth1/).and_return(false)
|
||||
|
||||
expect(chef_run).to run_execute(iplink)
|
||||
expect(chef_run).not_to run_execute(cmd)
|
||||
end
|
||||
|
||||
|
@ -122,6 +121,7 @@ describe 'openstack-network::l3_agent' do
|
|||
stub_command(/ovs-vsctl br-exists/).and_return(false)
|
||||
stub_command(/ip link show eth1/).and_return(true)
|
||||
|
||||
expect(chef_run).to run_execute(iplink)
|
||||
expect(chef_run).to run_execute(cmd)
|
||||
end
|
||||
|
||||
|
@ -129,6 +129,7 @@ describe 'openstack-network::l3_agent' do
|
|||
stub_command(/ovs-vsctl br-exists/).and_return(false)
|
||||
stub_command(/ip link show eth1/).and_return(true)
|
||||
|
||||
expect(chef_run).to run_execute(iplink)
|
||||
expect(chef_run).to run_execute(cmd)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue