Browse Source

Merge "Fixes for Ocata, style and lint fixes for chefdk"

Jenkins 1 year ago
parent
commit
3cdb3b94d4

+ 6
- 1
.rubocop_todo.yml View File

@@ -1,11 +1,16 @@
1 1
 # This configuration was generated by
2 2
 # `rubocop --auto-gen-config`
3
-# on 2017-02-23 16:58:33 +0100 using RuboCop version 0.39.0.
3
+# on 2017-08-01 10:43:38 -0400 using RuboCop version 0.47.1.
4 4
 # The point is for the user to remove these configuration records
5 5
 # one by one as the offenses are removed from the code base.
6 6
 # Note that changes in the inspected code, or installation of new
7 7
 # versions of RuboCop, may require this file to be generated again.
8 8
 
9
+# Offense count: 42
10
+# Configuration parameters: CountComments, ExcludedMethods.
11
+Metrics/BlockLength:
12
+  Max: 122
13
+
9 14
 # Offense count: 9
10 15
 # Configuration parameters: EnforcedStyle, SupportedStyles.
11 16
 # SupportedStyles: nested, compact

+ 9
- 8
metadata.rb View File

@@ -1,13 +1,10 @@
1
-# Encoding: utf-8
2
-name 'openstack-network'
3
-maintainer 'openstack-chef'
1
+name             'openstack-network'
2
+maintainer       'openstack-chef'
4 3
 maintainer_email 'openstack-dev@lists.openstack.org'
5
-issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url)
6
-source_url 'https://github.com/openstack/cookbook-openstack-network' if respond_to?(:source_url)
7
-license 'Apache 2.0'
8
-description 'Installs and configures the OpenStack Network API Service and various agents and plugins'
4
+license          'Apache 2.0'
5
+description      'Installs and configures the OpenStack Network API Service and various agents and plugins'
9 6
 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
10
-version '15.0.0'
7
+version          '15.0.0'
11 8
 
12 9
 %w(ubuntu redhat centos).each do |os|
13 10
   supports os
@@ -16,3 +13,7 @@ end
16 13
 depends 'openstack-common', '>= 15.0.0'
17 14
 depends 'openstack-identity', '>= 15.0.0'
18 15
 depends 'openstackclient'
16
+
17
+issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url)
18
+source_url 'https://github.com/openstack/cookbook-openstack-network' if respond_to?(:source_url)
19
+chef_version '>= 12.5' if respond_to?(:chef_version)

+ 5
- 5
recipes/db_migration.rb View File

@@ -23,9 +23,9 @@ timeout = node['openstack']['network']['dbsync_timeout']
23 23
 # The node['openstack']['network']['plugin_config_file'] attribute is set in the default.rb recipe
24 24
 bash 'migrate network database' do
25 25
   timeout timeout
26
-  migrate_command = "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file #{plugin_config_file}"
26
+  migrate_command = 'neutron-db-manage --config-file /etc/neutron/neutron.conf'
27 27
   code <<-EOF
28
-#{migrate_command} upgrade head
28
+#{migrate_command} upgrade heads
29 29
 EOF
30 30
 end
31 31
 
@@ -35,7 +35,7 @@ bash 'migrate vpnaas database' do
35 35
   timeout timeout
36 36
   migrate_command = "neutron-db-manage --subproject neutron-vpnaas --config-file /etc/neutron/neutron.conf --config-file #{plugin_config_file}"
37 37
   code <<-EOF
38
-#{migrate_command} upgrade head
38
+#{migrate_command} upgrade heads
39 39
 EOF
40 40
 end
41 41
 
@@ -45,7 +45,7 @@ bash 'migrate fwaas database' do
45 45
   timeout timeout
46 46
   migrate_command = "neutron-db-manage --subproject neutron-fwaas --config-file /etc/neutron/neutron.conf --config-file #{plugin_config_file}"
47 47
   code <<-EOF
48
-#{migrate_command} upgrade head
48
+#{migrate_command} upgrade heads
49 49
 EOF
50 50
 end
51 51
 
@@ -55,6 +55,6 @@ bash 'migrate lbaas database' do
55 55
   timeout timeout
56 56
   migrate_command = "neutron-db-manage --subproject neutron-lbaas --config-file /etc/neutron/neutron.conf --config-file #{plugin_config_file}"
57 57
   code <<-EOF
58
-#{migrate_command} upgrade head
58
+#{migrate_command} upgrade heads
59 59
 EOF
60 60
 end

+ 4
- 4
recipes/default.rb View File

@@ -51,14 +51,14 @@ end
51 51
 directory '/var/cache/neutron' do
52 52
   owner node['openstack']['network']['platform']['user']
53 53
   group node['openstack']['network']['platform']['group']
54
-  mode 00700
54
+  mode 0o0700
55 55
   action :create
56 56
 end
57 57
 
58 58
 directory node['openstack']['network']['api']['auth']['cache_dir'] do
59 59
   owner node['openstack']['network']['platform']['user']
60 60
   group node['openstack']['network']['platform']['group']
61
-  mode 00700
61
+  mode 0o0700
62 62
   only_if { node['openstack']['auth']['strategy'] == 'pki' }
63 63
 end
64 64
 
@@ -67,7 +67,7 @@ template '/etc/neutron/rootwrap.conf' do
67 67
   cookbook 'openstack-common'
68 68
   owner node['openstack']['network']['platform']['user']
69 69
   group node['openstack']['network']['platform']['group']
70
-  mode 00644
70
+  mode 0o0644
71 71
   variables(
72 72
     service_config: node['openstack']['network']['rootwrap']['conf']
73 73
   )
@@ -124,7 +124,7 @@ template '/etc/neutron/neutron.conf' do
124 124
   cookbook 'openstack-common'
125 125
   owner node['openstack']['network']['platform']['user']
126 126
   group node['openstack']['network']['platform']['group']
127
-  mode 00640
127
+  mode 0o0640
128 128
   variables(
129 129
     service_config: neutron_conf_options
130 130
   )

+ 2
- 2
recipes/dhcp_agent.rb View File

@@ -35,7 +35,7 @@ template '/etc/neutron/dnsmasq.conf' do
35 35
   source 'dnsmasq.conf.erb'
36 36
   owner node['openstack']['network']['platform']['user']
37 37
   group node['openstack']['network']['platform']['group']
38
-  mode 00644
38
+  mode 0o0644
39 39
 end
40 40
 
41 41
 service_config = merge_config_options 'network_dhcp'
@@ -44,7 +44,7 @@ template node['openstack']['network_dhcp']['config_file'] do
44 44
   cookbook 'openstack-common'
45 45
   owner node['openstack']['network']['platform']['user']
46 46
   group node['openstack']['network']['platform']['group']
47
-  mode 00644
47
+  mode 0o0644
48 48
   variables(
49 49
     service_config: service_config
50 50
   )

+ 1
- 1
recipes/fwaas.rb View File

@@ -33,7 +33,7 @@ template node['openstack']['network_fwaas']['config_file'] do
33 33
   cookbook 'openstack-common'
34 34
   owner node['openstack']['network']['platform']['user']
35 35
   group node['openstack']['network']['platform']['group']
36
-  mode 00640
36
+  mode 0o0640
37 37
   variables(
38 38
     service_config: service_conf
39 39
   )

+ 1
- 1
recipes/l3_agent.rb View File

@@ -40,7 +40,7 @@ template node['openstack']['network_l3']['config_file'] do
40 40
   cookbook 'openstack-common'
41 41
   owner node['openstack']['network']['platform']['user']
42 42
   group node['openstack']['network']['platform']['group']
43
-  mode 00640
43
+  mode 0o0640
44 44
   variables(
45 45
     service_config: service_config
46 46
   )

+ 1
- 1
recipes/lbaas.rb View File

@@ -42,7 +42,7 @@ template node['openstack']['network_lbaas']['config_file'] do
42 42
   cookbook 'openstack-common'
43 43
   owner node['openstack']['network']['platform']['user']
44 44
   group node['openstack']['network']['platform']['group']
45
-  mode 00640
45
+  mode 0o0640
46 46
   variables(
47 47
     service_config: service_config
48 48
   )

+ 1
- 1
recipes/metadata_agent.rb View File

@@ -43,7 +43,7 @@ template node['openstack']['network_metadata']['config_file'] do
43 43
   cookbook 'openstack-common'
44 44
   owner node['openstack']['network']['platform']['user']
45 45
   group node['openstack']['network']['platform']['group']
46
-  mode 00644
46
+  mode 0o0644
47 47
   variables(
48 48
     service_config: service_config
49 49
   )

+ 1
- 1
recipes/metering_agent.rb View File

@@ -33,7 +33,7 @@ template node['openstack']['network_metering']['config_file'] do
33 33
   cookbook 'openstack-common'
34 34
   owner node['openstack']['network']['platform']['user']
35 35
   group node['openstack']['network']['platform']['group']
36
-  mode 00640
36
+  mode 0o0640
37 37
   variables(
38 38
     service_config: service_config
39 39
   )

+ 3
- 1
recipes/ml2_linuxbridge.rb View File

@@ -25,7 +25,9 @@
25 25
 # proper directory when including the plugin_conf recipe in this cookbook. The
26 26
 # config can be filled via attributes (e.g. like done for the ml2_openvswitch).
27 27
 include_recipe 'openstack-network'
28
-node.default['openstack']['network']['plugins']['ml2']['conf']['ml2']['mechanism_drivers'] = 'linuxbridge'
28
+node.default['openstack']['network']['plugins']['ml2']['conf']['ml2']['type_drivers'] = 'local,flat,vlan,gre,vxlan'
29
+node.default['openstack']['network']['plugins']['ml2']['conf']['ml2']['mechanism_drivers'] = 'linuxbridge,l2population'
30
+node.default['openstack']['network']['plugins']['ml2']['conf']['ml2_type_vxlan']['vni_ranges'] = 'VNI_START:VNI_END'
29 31
 
30 32
 platform_options = node['openstack']['network']['platform']
31 33
 platform_options['neutron_linuxbridge_agent_packages'].each do |pkg|

+ 2
- 2
recipes/plugin_config.rb View File

@@ -22,7 +22,7 @@ node['openstack']['network']['plugins'].each_value do |plugin|
22 22
     recursive true
23 23
     owner node['openstack']['network']['platform']['user']
24 24
     group node['openstack']['network']['platform']['group']
25
-    mode 00700
25
+    mode 0o0700
26 26
   end
27 27
 
28 28
   template File.join(plugin['path'], plugin['filename']) do
@@ -30,7 +30,7 @@ node['openstack']['network']['plugins'].each_value do |plugin|
30 30
     cookbook 'openstack-common'
31 31
     owner node['openstack']['network']['platform']['user']
32 32
     group node['openstack']['network']['platform']['group']
33
-    mode 00644
33
+    mode 0o0644
34 34
     variables(
35 35
       service_config: plugin['conf']
36 36
     )

+ 3
- 3
recipes/server.rb View File

@@ -30,7 +30,7 @@ template '/etc/default/neutron-server' do
30 30
   source 'neutron-server.erb'
31 31
   owner 'root'
32 32
   group 'root'
33
-  mode 00644
33
+  mode 0o0644
34 34
   variables(
35 35
     core_plugin_config: node['openstack']['network']['core_plugin_config_file']
36 36
   )
@@ -59,7 +59,7 @@ if node['openstack']['network']['policyfile_url']
59 59
     source node['openstack']['network']['policyfile_url']
60 60
     owner node['openstack']['network']['platform']['user']
61 61
     group node['openstack']['network']['platform']['group']
62
-    mode 00644
62
+    mode 0o0644
63 63
   end
64 64
 end
65 65
 
@@ -92,7 +92,7 @@ end
92 92
 # Migrate network database to latest version
93 93
 include_recipe 'openstack-network::db_migration'
94 94
 plugin_templates = []
95
-node['openstack']['network']['plugins'].each_value do |plugin|
95
+node['openstack']['network']['plugins'].each_value.to_s do |plugin|
96 96
   plugin_templates << "template[#{File.join(plugin['path'], plugin['filename'])}]"
97 97
 end
98 98
 

+ 1
- 1
recipes/vpnaas.rb View File

@@ -56,7 +56,7 @@ template node['openstack']['network_vpnaas']['config_file'] do
56 56
   cookbook 'openstack-common'
57 57
   owner node['openstack']['network']['platform']['user']
58 58
   group node['openstack']['network']['platform']['group']
59
-  mode 00640
59
+  mode 0o0640
60 60
   variables(
61 61
     service_config: service_conf
62 62
   )

+ 4
- 4
spec/default_spec.rb View File

@@ -21,7 +21,7 @@ describe 'openstack-network' do
21 21
       expect(chef_run).to create_directory('/var/cache/neutron')
22 22
         .with(owner: 'neutron',
23 23
               group: 'neutron',
24
-              mode: 00700)
24
+              mode: 0o0700)
25 25
     end
26 26
 
27 27
     describe '/var/cache/neutron/api with pki set' do
@@ -32,7 +32,7 @@ describe 'openstack-network' do
32 32
         expect(chef_run).to create_directory('/var/cache/neutron/api')
33 33
           .with(owner: 'neutron',
34 34
                 group: 'neutron',
35
-                mode: 00700)
35
+                mode: 0o0700)
36 36
       end
37 37
     end
38 38
 
@@ -44,7 +44,7 @@ describe 'openstack-network' do
44 44
         expect(chef_run).not_to create_directory('/var/cache/neutron/api')
45 45
           .with(owner: 'neutron',
46 46
                 group: 'neutron',
47
-                mode: 00700)
47
+                mode: 0o0700)
48 48
       end
49 49
     end
50 50
 
@@ -116,7 +116,7 @@ describe 'openstack-network' do
116 116
         end
117 117
       end
118 118
       [
119
-        %r{^connection = mysql://neutron:neutron@127\.0\.0\.1:3306/neutron\?charset=utf8$}
119
+        %(connection = mysql+pymysql://neutron:neutron@127.0.0.1:3306/neutron?charset=utf8)
120 120
       ].each do |line|
121 121
         it do
122 122
           expect(chef_run).to render_config_file(file.name)

+ 2
- 2
spec/dhcp_agent-centos_spec.rb View File

@@ -42,7 +42,7 @@ describe 'openstack-network::dhcp_agent' do
42 42
         expect(chef_run).to create_template(file.name).with(
43 43
           user: 'neutron',
44 44
           group: 'neutron',
45
-          mode: 0644
45
+          mode: 0o644
46 46
         )
47 47
       end
48 48
     end
@@ -54,7 +54,7 @@ describe 'openstack-network::dhcp_agent' do
54 54
         expect(chef_run).to create_template(file.name).with(
55 55
           user: 'neutron',
56 56
           group: 'neutron',
57
-          mode: 0644
57
+          mode: 0o644
58 58
         )
59 59
       end
60 60
     end

+ 2
- 2
spec/dhcp_agent_spec.rb View File

@@ -33,7 +33,7 @@ describe 'openstack-network::dhcp_agent' do
33 33
         expect(chef_run).to create_template(file.name).with(
34 34
           user: 'neutron',
35 35
           group: 'neutron',
36
-          mode: 0644
36
+          mode: 0o644
37 37
         )
38 38
       end
39 39
     end
@@ -44,7 +44,7 @@ describe 'openstack-network::dhcp_agent' do
44 44
         expect(chef_run).to create_template(file.name).with(
45 45
           user: 'neutron',
46 46
           group: 'neutron',
47
-          mode: 0644
47
+          mode: 0o644
48 48
         )
49 49
       end
50 50
     end

+ 1
- 1
spec/l3_agent_spec.rb View File

@@ -33,7 +33,7 @@ describe 'openstack-network::l3_agent' do
33 33
           expect(chef_run).to create_template(file.name).with(
34 34
             user: 'neutron',
35 35
             group: 'neutron',
36
-            mode: 0640
36
+            mode: 0o640
37 37
           )
38 38
         end
39 39
 

+ 1
- 1
spec/lbaas-redhat_spec.rb View File

@@ -20,7 +20,7 @@ describe 'openstack-network::lbaas' do
20 20
         expect(chef_run).to create_template(file.name).with(
21 21
           user: 'neutron',
22 22
           group: 'neutron',
23
-          mode: 0640
23
+          mode: 0o640
24 24
         )
25 25
       end
26 26
 

+ 1
- 1
spec/lbaas_spec.rb View File

@@ -24,7 +24,7 @@ describe 'openstack-network::lbaas' do
24 24
         expect(chef_run).to create_template(file.name).with(
25 25
           user: 'neutron',
26 26
           group: 'neutron',
27
-          mode: 00640
27
+          mode: 0o0640
28 28
         )
29 29
       end
30 30
 

+ 1
- 1
spec/metadata_agent_spec.rb View File

@@ -29,7 +29,7 @@ describe 'openstack-network::metadata_agent' do
29 29
         expect(chef_run).to create_template(file.name).with(
30 30
           user: 'neutron',
31 31
           group: 'neutron',
32
-          mode: 0644
32
+          mode: 0o644
33 33
         )
34 34
       end
35 35
 

+ 1
- 1
spec/metering_agent_spec.rb View File

@@ -24,7 +24,7 @@ describe 'openstack-network::metering_agent' do
24 24
         expect(chef_run).to create_template(file.name).with(
25 25
           user: 'neutron',
26 26
           group: 'neutron',
27
-          mode: 00640
27
+          mode: 0o0640
28 28
         )
29 29
       end
30 30
 

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

@@ -25,7 +25,7 @@ describe 'openstack-network::ml2_linuxbridge' do
25 25
       expect(chef_run).to create_directory('/etc/neutron/plugins/ml2').with(
26 26
         owner: 'neutron',
27 27
         group: 'neutron',
28
-        mode: 0700
28
+        mode: 0o700
29 29
       )
30 30
     end
31 31
     it do

+ 1
- 1
spec/ml2_linuxbridge_spec.rb View File

@@ -26,7 +26,7 @@ describe 'openstack-network::ml2_linuxbridge' do
26 26
       expect(chef_run).to create_directory('/etc/neutron/plugins/linuxbridge').with(
27 27
         owner: 'neutron',
28 28
         group: 'neutron',
29
-        mode: 0700
29
+        mode: 0o700
30 30
       )
31 31
     end
32 32
     it do

+ 1
- 1
spec/plugin_config_spec.rb View File

@@ -30,7 +30,7 @@ describe 'openstack-network::plugin_config' do
30 30
             recursive: true,
31 31
             owner: 'neutron',
32 32
             group: 'neutron',
33
-            mode: 00700
33
+            mode: 0o0700
34 34
           )
35 35
       end
36 36
 

+ 4
- 3
spec/server_spec.rb View File

@@ -54,7 +54,8 @@ describe 'openstack-network::server' do
54 54
         node.set['openstack']['network']['platform']['neutron_server_service'] = 'my-neutron-server'
55 55
 
56 56
         expect(chef_run).to enable_service('neutron-server').with(
57
-          service_name: 'my-neutron-server')
57
+          service_name: 'my-neutron-server'
58
+        )
58 59
       end
59 60
 
60 61
       it 'allows overriding package options' do
@@ -78,7 +79,7 @@ describe 'openstack-network::server' do
78 79
         expect(chef_run).to create_template(file.name).with(
79 80
           user: 'root',
80 81
           group: 'root',
81
-          mode: 0644
82
+          mode: 0o644
82 83
         )
83 84
       end
84 85
     end
@@ -90,7 +91,7 @@ describe 'openstack-network::server' do
90 91
         expect(chef_run).to create_template(file.name).with(
91 92
           user: 'neutron',
92 93
           group: 'neutron',
93
-          mode: 0644
94
+          mode: 0o644
94 95
         )
95 96
       end
96 97
 

+ 1
- 1
spec/vpnaas_spec.rb View File

@@ -47,7 +47,7 @@ describe 'openstack-network::vpnaas' do
47 47
         expect(chef_run).to create_template(file.name).with(
48 48
           user: 'neutron',
49 49
           group: 'neutron',
50
-          mode: 0640
50
+          mode: 0o640
51 51
         )
52 52
       end
53 53
 

Loading…
Cancel
Save