From 0a7e0f1b7fbed8805ef7bac15409753491dd2274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Gagne=CC=81?= Date: Fri, 15 Aug 2014 11:49:28 -0400 Subject: [PATCH] Add plugin config file to /etc/default/neutron-server Debian platforms uses /etc/default/neutron-server to tell neutron-server service which plugin configuration file to load. Configure it. Change-Id: I0638d2584ad327ae1ed77f672d5efb1c28064aa2 Closes-bug: #1357431 (cherry picked from commit c848aff801e7c84740eae661da3c0c101a930628) --- manifests/plugins/ml2.pp | 11 +++++++++++ spec/classes/neutron_plugins_ml2_spec.rb | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/manifests/plugins/ml2.pp b/manifests/plugins/ml2.pp index e5c115c57..76c9ecc7e 100644 --- a/manifests/plugins/ml2.pp +++ b/manifests/plugins/ml2.pp @@ -112,6 +112,17 @@ warning('Without networking mechanism driver, ml2 will not communicate with L2 agents') } + if $::osfamily == 'Debian' { + file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG': + path => '/etc/default/neutron-server', + match => '^NEUTRON_PLUGIN_CONFIG=(.*)$', + line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugin.ini', + require => File['/etc/neutron/plugin.ini'], + } + File_line['/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG'] + ~> Service<| title == 'neutron-server' |> + } + # In RH, the link is used to start Neutron process but in Debian, it's used only # to manage database synchronization. file {'/etc/neutron/plugin.ini': diff --git a/spec/classes/neutron_plugins_ml2_spec.rb b/spec/classes/neutron_plugins_ml2_spec.rb index efbb838db..395821b3e 100644 --- a/spec/classes/neutron_plugins_ml2_spec.rb +++ b/spec/classes/neutron_plugins_ml2_spec.rb @@ -178,6 +178,15 @@ {} end + it 'configures /etc/default/neutron-server' do + should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with( + :path => '/etc/default/neutron-server', + :match => '^NEUTRON_PLUGIN_CONFIG=(.*)$', + :line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugin.ini', + :require => ['File[/etc/neutron/plugin.ini]'] + ) + end + context 'on Ubuntu operating systems' do before do facts.merge!({:operatingsystem => 'Ubuntu'})