Skip to content

Commit ef3ca7f

Browse files
author
Emilien Macchi
committed
/etc/default/neutron-server file is only on Ubuntu packages
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
1 parent 3445712 commit ef3ca7f

6 files changed

Lines changed: 64 additions & 26 deletions

File tree

manifests/plugins/cisco.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
Package['neutron'] -> Neutron_plugin_cisco_l2network<||>
110110
}
111111

112-
if $::osfamily == 'Debian' {
112+
if $::operatingsystem == 'Ubuntu' {
113113
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
114114
path => '/etc/default/neutron-server',
115115
match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',

manifests/plugins/linuxbridge.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
Neutron_plugin_linuxbridge<||> ~> Service<| title == 'neutron-server' |>
3636
Package['neutron-plugin-linuxbridge'] -> Service<| title == 'neutron-server' |>
3737

38-
if $::osfamily == 'Debian' {
38+
if $::operatingsystem == 'Ubuntu' {
3939
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
4040
path => '/etc/default/neutron-server',
4141
match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',

manifests/plugins/ml2.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
warning('Without networking mechanism driver, ml2 will not communicate with L2 agents')
112112
}
113113

114-
if $::osfamily == 'Debian' {
114+
if $::operatingsystem == 'Ubuntu' {
115115
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
116116
path => '/etc/default/neutron-server',
117117
match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',

spec/classes/neutron_plugins_cisco_spec.rb

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,29 @@ class { 'neutron': rabbit_password => 'passw0rd' }"
134134
{ :osfamily => 'Debian' }
135135
end
136136

137-
it_configures 'default cisco plugin'
138-
it 'configures /etc/default/neutron-server' do
139-
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
140-
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/cisco/cisco_plugins.ini',
141-
:require => ['Package[neutron-server]', 'Package[neutron-plugin-cisco]']
142-
)
137+
context 'on Ubuntu operating systems' do
138+
before do
139+
facts.merge!({:operatingsystem => 'Ubuntu'})
140+
end
141+
142+
it 'configures /etc/default/neutron-server' do
143+
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
144+
:path => '/etc/default/neutron-server',
145+
:match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
146+
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/cisco/cisco_plugins.ini',
147+
:require => ['Package[neutron-server]', 'Package[neutron-plugin-cisco]'],
148+
:notify => 'Service[neutron-server]'
149+
)
150+
end
151+
it_configures 'default cisco plugin'
152+
end
153+
154+
context 'on Debian operating systems' do
155+
before do
156+
facts.merge!({:operatingsystem => 'Debian'})
157+
end
158+
159+
it_configures 'default cisco plugin'
143160
end
144161
end
145162

spec/classes/neutron_plugins_linuxbridge_spec.rb

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@
4141
:require => 'Package[neutron-plugin-linuxbridge]'
4242
)
4343
end
44-
4544
end
4645

47-
4846
context 'on Debian platforms' do
4947
let :facts do
5048
{ :osfamily => 'Debian' }
@@ -54,12 +52,29 @@
5452
{ :linuxbridge_plugin_package => 'neutron-plugin-linuxbridge' }
5553
end
5654

57-
it_configures 'neutron linuxbridge plugin'
58-
it 'configures /etc/default/neutron-server' do
59-
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
60-
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini',
61-
:require => ['Package[neutron-plugin-linuxbridge]', 'Package[neutron-server]']
62-
)
55+
context 'on Ubuntu operating systems' do
56+
before do
57+
facts.merge!({:operatingsystem => 'Ubuntu'})
58+
end
59+
60+
it 'configures /etc/default/neutron-server' do
61+
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
62+
:path => '/etc/default/neutron-server',
63+
:match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
64+
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini',
65+
:require => ['Package[neutron-plugin-linuxbridge]', 'Package[neutron-server]'],
66+
:notify => 'Service[neutron-server]'
67+
)
68+
end
69+
it_configures 'neutron linuxbridge plugin'
70+
end
71+
72+
context 'on Debian operating systems' do
73+
before do
74+
facts.merge!({:operatingsystem => 'Debian'})
75+
end
76+
77+
it_configures 'neutron linuxbridge plugin'
6378
end
6479
end
6580

spec/classes/neutron_plugins_ml2_spec.rb

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,21 @@
182182
end
183183
end
184184
end
185+
186+
context 'on Ubuntu operating systems' do
187+
before do
188+
facts.merge!({:operatingsystem => 'Ubuntu'})
189+
end
190+
191+
it 'configures /etc/default/neutron-server' do
192+
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
193+
:path => '/etc/default/neutron-server',
194+
:match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
195+
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugin.ini',
196+
:require => ['File[/etc/neutron/plugin.ini]']
197+
)
198+
end
199+
end
185200
end
186201

187202
context 'on Debian platforms' do
@@ -193,15 +208,6 @@
193208
{}
194209
end
195210

196-
it 'configures /etc/default/neutron-server' do
197-
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
198-
:path => '/etc/default/neutron-server',
199-
:match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
200-
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugin.ini',
201-
:require => ['File[/etc/neutron/plugin.ini]']
202-
)
203-
end
204-
205211
context 'on Ubuntu operating systems' do
206212
before do
207213
facts.merge!({:operatingsystem => 'Ubuntu'})

0 commit comments

Comments
 (0)