Skip to content

Commit

Permalink
/etc/default/neutron-server file is only on Ubuntu packages
Browse files Browse the repository at this point in the history
The /etc/default/neutron-server file is only present in Ubuntu packages,
not in Debian.
Let's change the fact to detect Ubuntu instead of Debian operating
system.

Change-Id: Iac73b475bfc8ac7f9f97a858ab836a4d07afac5f
  • Loading branch information
Emilien Macchi committed Sep 20, 2014
1 parent 3445712 commit ef3ca7f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 26 deletions.
2 changes: 1 addition & 1 deletion manifests/plugins/cisco.pp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
Package['neutron'] -> Neutron_plugin_cisco_l2network<||>
}

if $::osfamily == 'Debian' {
if $::operatingsystem == 'Ubuntu' {
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
path => '/etc/default/neutron-server',
match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
Expand Down
2 changes: 1 addition & 1 deletion manifests/plugins/linuxbridge.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
Neutron_plugin_linuxbridge<||> ~> Service<| title == 'neutron-server' |>
Package['neutron-plugin-linuxbridge'] -> Service<| title == 'neutron-server' |>

if $::osfamily == 'Debian' {
if $::operatingsystem == 'Ubuntu' {
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
path => '/etc/default/neutron-server',
match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
Expand Down
2 changes: 1 addition & 1 deletion manifests/plugins/ml2.pp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
warning('Without networking mechanism driver, ml2 will not communicate with L2 agents')
}

if $::osfamily == 'Debian' {
if $::operatingsystem == 'Ubuntu' {
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
path => '/etc/default/neutron-server',
match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
Expand Down
29 changes: 23 additions & 6 deletions spec/classes/neutron_plugins_cisco_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,29 @@ class { 'neutron': rabbit_password => 'passw0rd' }"
{ :osfamily => 'Debian' }
end

it_configures 'default cisco plugin'
it 'configures /etc/default/neutron-server' do
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/cisco/cisco_plugins.ini',
:require => ['Package[neutron-server]', 'Package[neutron-plugin-cisco]']
)
context 'on Ubuntu operating systems' do
before do
facts.merge!({:operatingsystem => 'Ubuntu'})
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/plugins/cisco/cisco_plugins.ini',
:require => ['Package[neutron-server]', 'Package[neutron-plugin-cisco]'],
:notify => 'Service[neutron-server]'
)
end
it_configures 'default cisco plugin'
end

context 'on Debian operating systems' do
before do
facts.merge!({:operatingsystem => 'Debian'})
end

it_configures 'default cisco plugin'
end
end

Expand Down
31 changes: 23 additions & 8 deletions spec/classes/neutron_plugins_linuxbridge_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@
:require => 'Package[neutron-plugin-linuxbridge]'
)
end

end


context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
Expand All @@ -54,12 +52,29 @@
{ :linuxbridge_plugin_package => 'neutron-plugin-linuxbridge' }
end

it_configures 'neutron linuxbridge plugin'
it 'configures /etc/default/neutron-server' do
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini',
:require => ['Package[neutron-plugin-linuxbridge]', 'Package[neutron-server]']
)
context 'on Ubuntu operating systems' do
before do
facts.merge!({:operatingsystem => 'Ubuntu'})
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/plugins/linuxbridge/linuxbridge_conf.ini',
:require => ['Package[neutron-plugin-linuxbridge]', 'Package[neutron-server]'],
:notify => 'Service[neutron-server]'
)
end
it_configures 'neutron linuxbridge plugin'
end

context 'on Debian operating systems' do
before do
facts.merge!({:operatingsystem => 'Debian'})
end

it_configures 'neutron linuxbridge plugin'
end
end

Expand Down
24 changes: 15 additions & 9 deletions spec/classes/neutron_plugins_ml2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,21 @@
end
end
end

context 'on Ubuntu operating systems' do
before do
facts.merge!({:operatingsystem => 'Ubuntu'})
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
end
end

context 'on Debian platforms' do
Expand All @@ -193,15 +208,6 @@
{}
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'})
Expand Down

0 comments on commit ef3ca7f

Please sign in to comment.