Browse Source

Fix LinuxBridge file paths and names for RHEL

This was incorrectly assuming the path used on Ubuntu/Debian. This correctly
points to the correct location that systemd uses.

Change-Id: I425f4dc565f7c6d5b27422f1023b428e91f71d7a
Signed-off-by: Lance Albertson <lance@osuosl.org>
Lance Albertson 2 years ago
parent
commit
69454c062f
2 changed files with 19 additions and 11 deletions
  1. 12
    4
      recipes/ml2_linuxbridge.rb
  2. 7
    7
      spec/ml2_linuxbridge-redhat_spec.rb

+ 12
- 4
recipes/ml2_linuxbridge.rb View File

@@ -36,10 +36,18 @@ platform_options['neutron_linuxbridge_agent_packages'].each do |pkg|
36 36
 end
37 37
 
38 38
 node.default['openstack']['network']['plugins']['linuxbridge'].tap do |lb|
39
-  lb['path'] =
40
-    '/etc/neutron/plugins/linuxbridge'
41
-  lb['filename'] =
42
-    'linuxbridge_conf.ini'
39
+  case node['platform_family']
40
+  when 'fedora', 'rhel'
41
+    lb['path'] =
42
+      '/etc/neutron/plugins/ml2'
43
+    lb['filename'] =
44
+      'linuxbridge_agent.ini'
45
+  when 'debian'
46
+    lb['path'] =
47
+      '/etc/neutron/plugins/linuxbridge'
48
+    lb['filename'] =
49
+      'linuxbridge_conf.ini'
50
+  end
43 51
   lb['conf']['securitygroup']['firewall_driver'] =
44 52
     'neutron.agent.linux.iptables_firewall.IptablesFirewallDriver'
45 53
 end

+ 7
- 7
spec/ml2_linuxbridge-redhat_spec.rb View File

@@ -17,12 +17,12 @@ describe 'openstack-network::ml2_linuxbridge' do
17 17
 
18 18
     before do
19 19
       node.set['openstack']['network']['plugins']['linuxbridge']['path'] =
20
-        '/etc/neutron/plugins/linuxbridge'
20
+        '/etc/neutron/plugins/ml2'
21 21
       node.set['openstack']['network']['plugins']['linuxbridge']['filename'] =
22
-        'linuxbridge_conf.ini'
22
+        'linuxbridge_agent.ini'
23 23
     end
24
-    it 'creates the /etc/neutron/plugins/linuxbridge agent directory' do
25
-      expect(chef_run).to create_directory('/etc/neutron/plugins/linuxbridge').with(
24
+    it 'creates the /etc/neutron/plugins/ml2 agent directory' do
25
+      expect(chef_run).to create_directory('/etc/neutron/plugins/ml2').with(
26 26
         owner: 'neutron',
27 27
         group: 'neutron',
28 28
         mode: 0700
@@ -32,9 +32,9 @@ describe 'openstack-network::ml2_linuxbridge' do
32 32
       expect(chef_run).to include_recipe('openstack-network::plugin_config')
33 33
     end
34 34
 
35
-    describe '/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini' do
35
+    describe '/etc/neutron/plugins/ml2/linuxbridge_agent.ini' do
36 36
       let(:file) do
37
-        chef_run.template('/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini')
37
+        chef_run.template('/etc/neutron/plugins/ml2/linuxbridge_agent.ini')
38 38
       end
39 39
       [
40 40
         /^firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver$/
@@ -57,7 +57,7 @@ describe 'openstack-network::ml2_linuxbridge' do
57 57
     end
58 58
     it do
59 59
       service = chef_run.service('neutron-linuxbridge-agent')
60
-      expect(service).to(subscribe_to('template[/etc/neutron/neutron.conf]').on(:restart).delayed) && subscribe_to('template[/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini]').on(:restart).delayed
60
+      expect(service).to(subscribe_to('template[/etc/neutron/neutron.conf]').on(:restart).delayed) && subscribe_to('template[/etc/neutron/plugins/ml2/linuxbridge_agent.ini]').on(:restart).delayed
61 61
     end
62 62
   end
63 63
 end

Loading…
Cancel
Save