Browse Source

Initial block-storage Pike updates

- Changed the default linter to cookstyle
- cinder-group-active was missing a Provides header for the SysV init script
- Switched the qemu package to SCL for CentOS to get a newer release
- Normalized template banner comment

Change-Id: Iec59e0c8e3cb0b83db92a0a9f8db34a40953351f
Samuel Cassiba 1 year ago
parent
commit
60a38b538d

+ 0
- 2
.rubocop.yml View File

@@ -1,5 +1,3 @@
1
-inherit_from: .rubocop_todo.yml
2
-
3 1
 AllCops:
4 2
   Include:
5 3
     - metadata.rb

+ 0
- 22
.rubocop_todo.yml View File

@@ -1,22 +0,0 @@
1
-# This configuration was generated by
2
-# `rubocop --auto-gen-config`
3
-# on 2017-08-17 14:15:59 +0200 using RuboCop version 0.47.1.
4
-# The point is for the user to remove these configuration records
5
-# one by one as the offenses are removed from the code base.
6
-# Note that changes in the inspected code, or installation of new
7
-# versions of RuboCop, may require this file to be generated again.
8
-
9
-# Offense count: 18
10
-# Configuration parameters: CountComments, ExcludedMethods.
11
-Metrics/BlockLength:
12
-  Max: 178
13
-
14
-# Offense count: 4
15
-# Configuration parameters: EnforcedStyle, SupportedStyles.
16
-# SupportedStyles: nested, compact
17
-Style/ClassAndModuleChildren:
18
-  Exclude:
19
-    - 'recipes/api.rb'
20
-    - 'recipes/cinder-common.rb'
21
-    - 'recipes/identity_registration.rb'
22
-    - 'recipes/volume.rb'

+ 7
- 7
Rakefile View File

@@ -1,20 +1,20 @@
1 1
 task default: ["test"]
2 2
 
3
-task :test => [:lint, :style, :unit]
3
+task :test => [:syntax, :lint, :unit]
4 4
 
5 5
 desc "Vendor the cookbooks in the Berksfile"
6 6
 task :berks_prep do
7 7
   sh %{chef exec berks vendor}
8 8
 end
9 9
 
10
-desc "Run FoodCritic (lint) tests"
11
-task :lint do
12
-  sh %{chef exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .}
10
+desc "Run FoodCritic (syntax) tests"
11
+task :syntax do
12
+  sh %{chef exec foodcritic --exclude spec -f any .}
13 13
 end
14 14
 
15
-desc "Run RuboCop (style) tests"
16
-task :style do
17
-  sh %{chef exec rubocop}
15
+desc "Run RuboCop (lint) tests"
16
+task :lint do
17
+  sh %{chef exec cookstyle}
18 18
 end
19 19
 
20 20
 desc "Run RSpec (unit) tests"

+ 5
- 5
attributes/default.rb View File

@@ -30,8 +30,8 @@ default['developer_mode'] = false # we want secure passwords by default
30 30
 # Set to some text value if you want templated config files
31 31
 # to contain a custom banner at the top of the written file
32 32
 default['openstack']['block-storage']['custom_template_banner'] = '
33
-# This file autogenerated by Chef
34
-# Do not edit, changes will be overwritten
33
+# This file is automatically generated by Chef
34
+# Any changes will be overwritten
35 35
 '
36 36
 
37 37
 # Specify policy.json remote file to import
@@ -79,7 +79,7 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
79 79
     'cinder_common_packages' => ['openstack-cinder'],
80 80
     'cinder_api_packages' => ['openstack-cinder'],
81 81
     'cinder_api_service' => 'openstack-cinder-api',
82
-    'cinder_volume_packages' => ['qemu-img'],
82
+    'cinder_volume_packages' => ['qemu-img-ev'],
83 83
     'cinder_volume_service' => 'openstack-cinder-volume',
84 84
     'cinder_scheduler_packages' => [],
85 85
     'cinder_scheduler_service' => 'openstack-cinder-scheduler',
@@ -93,7 +93,7 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
93 93
     'cinder_svc_packages' => ['sysfsutils'],
94 94
     'cinder_lvm_packages' => ['lvm2'],
95 95
     'cinder_flashsystem_packages' => ['sysfsutils'],
96
-    'package_overrides' => ''
96
+    'package_overrides' => '',
97 97
   }
98 98
 when 'debian'
99 99
   # operating system user and group names
@@ -115,7 +115,7 @@ when 'debian'
115 115
     'cinder_svc_packages' => ['sysfsutils'],
116 116
     'cinder_lvm_packages' => ['lvm2'],
117 117
     'cinder_flashsystem_packages' => ['sysfsutils'],
118
-    'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
118
+    'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'",
119 119
   }
120 120
 end
121 121
 

+ 2
- 2
recipes/identity_registration.rb View File

@@ -32,7 +32,7 @@ auth_url = ::URI.decode identity_admin_endpoint.to_s
32 32
 interfaces = {
33 33
   public: { url: public_endpoint('block-storage') },
34 34
   internal: { url: internal_endpoint('block-storage') },
35
-  admin: { url: admin_endpoint('block-storage') }
35
+  admin: { url: admin_endpoint('block-storage') },
36 36
 }
37 37
 service_pass = get_password 'service', 'openstack-block-storage'
38 38
 region = node['openstack']['block-storage']['region']
@@ -52,7 +52,7 @@ connection_params = {
52 52
   openstack_username:     admin_user,
53 53
   openstack_api_key:      admin_pass,
54 54
   openstack_project_name: admin_project,
55
-  openstack_domain_name:    admin_domain
55
+  openstack_domain_name:    admin_domain,
56 56
 }
57 57
 
58 58
 # Register VolumeV2 Service

+ 1
- 1
spec/cinder_common_spec.rb View File

@@ -208,7 +208,7 @@ describe 'openstack-block-storage::cinder-common' do
208 208
             %r{^exec_dirs = /sbin,/usr/sbin,/bin,/usr/bin$},
209 209
             /^use_syslog = false$/,
210 210
             /^syslog_log_facility = syslog$/,
211
-            /^syslog_log_level = ERROR$/
211
+            /^syslog_log_level = ERROR$/,
212 212
           ].each do |line|
213 213
             expect(chef_run).to render_file(file.name).with_content(line)
214 214
           end

+ 1
- 1
spec/identity_registration_spec.rb View File

@@ -17,7 +17,7 @@ describe 'openstack-block-storage::identity_registration' do
17 17
       openstack_username: 'admin',
18 18
       openstack_api_key: 'emc_test_pass',
19 19
       openstack_project_name: 'admin',
20
-      openstack_domain_name: 'default'
20
+      openstack_domain_name: 'default',
21 21
     }
22 22
     service_name = 'cinderv2'
23 23
     service_type = 'volumev2'

+ 4
- 4
spec/spec_helper.rb View File

@@ -13,12 +13,12 @@ LOG_LEVEL = :fatal
13 13
 REDHAT_OPTS = {
14 14
   platform: 'redhat',
15 15
   version: '7.1',
16
-  log_level: LOG_LEVEL
16
+  log_level: LOG_LEVEL,
17 17
 }.freeze
18 18
 UBUNTU_OPTS = {
19 19
   platform: 'ubuntu',
20 20
   version: '16.04',
21
-  log_level: LOG_LEVEL
21
+  log_level: LOG_LEVEL,
22 22
 }.freeze
23 23
 
24 24
 shared_context 'block-storage-stubs' do
@@ -116,7 +116,7 @@ shared_examples 'creates_cinder_conf' do |service, user, group, action = :restar
116 116
         /^project_domain_name = Default/,
117 117
         %r{^auth_uri = http://127.0.0.1:5000/v3$},
118 118
         %r{^auth_url = http://127.0.0.1:35357/v3$},
119
-        /^password = cinder-pass$/
119
+        /^password = cinder-pass$/,
120 120
       ].each do |line|
121 121
         expect(chef_run).to render_config_file(file.name)
122 122
           .with_section_content('keystone_authtoken', line)
@@ -125,7 +125,7 @@ shared_examples 'creates_cinder_conf' do |service, user, group, action = :restar
125 125
 
126 126
     it 'has oslo_messaging_notifications conf values' do
127 127
       [
128
-        /^driver = cinder.openstack.common.notifier.rpc_notifier$/
128
+        /^driver = cinder.openstack.common.notifier.rpc_notifier$/,
129 129
       ].each do |line|
130 130
         expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_notifications', line)
131 131
       end

+ 2
- 2
spec/volume-redhat_spec.rb View File

@@ -23,8 +23,8 @@ describe 'openstack-block-storage::volume' do
23 23
       expect(chef_run).not_to upgrade_package('MySQL-python')
24 24
     end
25 25
 
26
-    it 'upgrades qemu img package' do
27
-      expect(chef_run).to upgrade_package('qemu-img')
26
+    it 'upgrades qemu-img-ev package' do
27
+      expect(chef_run).to upgrade_package('qemu-img-ev')
28 28
     end
29 29
 
30 30
     it 'upgrades cinder iscsi package' do

+ 1
- 0
templates/default/cinder-group-active.erb View File

@@ -7,6 +7,7 @@
7 7
 # chkconfig: - 98 02
8 8
 #
9 9
 ### BEGIN INIT INFO
10
+# Provides: cinder-group-active
10 11
 # Required-Start: $remote_fs $network $syslog
11 12
 # Required-Stop: $remote_fs $syslog
12 13
 # Default-Start: 2 3 4 5

Loading…
Cancel
Save