Merge "Ml2 plugin tpl should be in a 'case' declaration like other tpl"

This commit is contained in:
Jenkins 2014-03-24 17:09:44 +00:00 committed by Gerrit Code Review
commit 1b204b6c75
4 changed files with 30 additions and 12 deletions

View File

@ -147,6 +147,7 @@ default['openstack']['network']['service_plugins'] = []
#
# - neutron.agent.linux.interface.OVSInterfaceDriver
# - neutron.agent.linux.interface.BridgeInterfaceDriver
# - neutron.agent.linux.interface.Ml2InterfaceDriver
#
default['openstack']['network']['interface_driver'] = 'neutron.agent.linux.interface.OVSInterfaceDriver'
@ -154,12 +155,14 @@ default['openstack']['network']['interface_driver'] = 'neutron.agent.linux.inter
# maps the above driver to a plugin name
default['openstack']['network']['interface_driver_map'] = {
'ovsinterfacedriver' => 'openvswitch',
'bridgeinterfacedriver' => 'linuxbridge'
'bridgeinterfacedriver' => 'linuxbridge',
'ml2interfacedriver' => 'ml2'
}
default['openstack']['network']['plugin_conf_map'] = {
'ovsinterfacedriver' => 'openvswitch/ovs_neutron_plugin.ini',
'bridgeinterfacedriver' => 'linuxbridge/linuxbridge_conf.ini'
'bridgeinterfacedriver' => 'linuxbridge/linuxbridge_conf.ini',
'ml2interfacedriver' => 'ml2/ml2_conf.ini'
}
# The agent can use other DHCP drivers. Dnsmasq is the simplest and requires

View File

@ -191,15 +191,6 @@ end
# physical servers like the l3 agent, so we assume
# the plugin configuration is a "common" file
template '/etc/neutron/plugins/ml2/ml2_conf.ini' do
source 'plugins/ml2/ml2_conf.ini.erb'
owner node['openstack']['network']['platform']['user']
group node['openstack']['network']['platform']['group']
mode 00644
notifies :restart, 'service[neutron-server]', :delayed
end
template_file = nil
plugin_file = '/etc/neutron/plugin.ini'
@ -300,6 +291,20 @@ when 'midonet'
notifies :restart, 'service[neutron-server]', :delayed
end
when 'ml2'
template_file = '/etc/neutron/plugins/ml2/ml2_conf.ini'
template template_file do
source 'plugins/ml2/ml2_conf.ini.erb'
owner node['openstack']['network']['platform']['user']
group node['openstack']['network']['platform']['group']
mode 00644
notifies :create, "link[#{plugin_file}]", :immediately
notifies :restart, 'service[neutron-server]', :delayed
end
when 'nec'
template_file = '/etc/neutron/plugins/nec/nec.ini'

View File

@ -43,9 +43,11 @@ end
# Migrate network database
# If the database has never migrated, make the current version of alembic_version to havana,
# else migrate the database to latest version.
# The node['openstack']['network']['plugin_config_file'] attribute is set in the common.rb recipe
bash 'migrate network database' do
plugin_config_file = node['openstack']['network']['plugin_config_file']
migrate_command = "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini --config-file #{plugin_config_file}"
migrate_command = "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file #{plugin_config_file}"
code <<-EOF
current_version_line=`#{migrate_command} current 2>&1 | tail -n 1`
# determine if the $current_version_line ends with ": None"

View File

@ -521,9 +521,17 @@ describe 'openstack-network::server' do
describe '/etc/neutron/plugins/ml2/ml2_conf.ini' do
before do
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
@chef_run.node.set['openstack']['compute']['network']['service_type'] = 'neutron'
@chef_run.node.set['openstack']['network']['interface_driver'] = 'neutron.agent.linux.interface.Ml2InterfaceDriver'
@chef_run.converge 'openstack-network::server'
@file = @chef_run.template('/etc/neutron/plugins/ml2/ml2_conf.ini')
end
it 'create template ml2_conf.ini' do
expect(@chef_run).to render_file(@file.name)
end
it 'has proper owner' do
expect(@file.owner).to eq('neutron')
expect(@file.group).to eq('neutron')