Browse Source

Initial ops-database Pike updates

- Switched default linter to cookstyle
- Renamed rake tasks to better conform with Chef conventions
- Normalized template banner

Change-Id: I76bdb4149965ab7b23709762559bd6c71753cc8b
Samuel Cassiba 1 year ago
parent
commit
b876cd00e5

+ 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
- 23
.rubocop_todo.yml View File

@@ -1,23 +0,0 @@
1
-# This configuration was generated by
2
-# `rubocop --auto-gen-config`
3
-# on 2017-08-17 14:16:18 +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: 6
10
-# Configuration parameters: CountComments, ExcludedMethods.
11
-Metrics/BlockLength:
12
-  Max: 62
13
-
14
-# Offense count: 5
15
-# Configuration parameters: EnforcedStyle, SupportedStyles.
16
-# SupportedStyles: nested, compact
17
-Style/ClassAndModuleChildren:
18
-  Exclude:
19
-    - 'recipes/mariadb-server.rb'
20
-    - 'recipes/mysql-server.rb'
21
-    - 'recipes/openstack-db.rb'
22
-    - 'recipes/percona-cluster-server.rb'
23
-    - 'recipes/postgresql-server.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"

+ 2
- 2
attributes/default.rb View File

@@ -21,6 +21,6 @@
21 21
 # Set to some text value if you want templated config files
22 22
 # to contain a custom banner at the top of the written file
23 23
 default['openstack']['db']['custom_template_banner'] = '
24
-# This file is autogenerated by Chef.
25
-# Do not edit. Your changes will be overwritten!
24
+# This file is automatically generated by Chef
25
+# Any changes will be overwritten
26 26
 '

+ 2
- 2
recipes/mariadb-server.rb View File

@@ -16,7 +16,7 @@
16 16
 # limitations under the License.
17 17
 #
18 18
 
19
-class ::Chef::Recipe # rubocop:disable Documentation
19
+class ::Chef::Recipe
20 20
   include ::Openstack
21 21
 end
22 22
 
@@ -59,7 +59,7 @@ end
59 59
 mysql_connection_info = {
60 60
   host: 'localhost',
61 61
   username: 'root',
62
-  password: super_password
62
+  password: super_password,
63 63
 }
64 64
 
65 65
 mysql_database 'drop empty and default users' do

+ 1
- 1
recipes/mysql-server.rb View File

@@ -20,7 +20,7 @@
20 20
 # limitations under the License.
21 21
 #
22 22
 
23
-class ::Chef::Recipe # rubocop:disable Documentation
23
+class ::Chef::Recipe
24 24
   include ::Openstack
25 25
 end
26 26
 

+ 1
- 1
recipes/openstack-db.rb View File

@@ -18,7 +18,7 @@
18 18
 # limitations under the License.
19 19
 #
20 20
 
21
-class ::Chef::Recipe # rubocop:disable Documentation
21
+class ::Chef::Recipe
22 22
   include ::Openstack
23 23
 end
24 24
 

+ 1
- 1
recipes/percona-cluster-server.rb View File

@@ -16,7 +16,7 @@
16 16
 # limitations under the License.
17 17
 #
18 18
 
19
-class ::Chef::Recipe # rubocop:disable Documentation
19
+class ::Chef::Recipe
20 20
   include ::Openstack
21 21
 end
22 22
 

+ 1
- 1
recipes/postgresql-server.rb View File

@@ -21,7 +21,7 @@
21 21
 # limitations under the License.
22 22
 #
23 23
 
24
-class ::Chef::Recipe # rubocop:disable Documentation
24
+class ::Chef::Recipe
25 25
   include ::Openstack
26 26
 end
27 27
 

+ 1
- 1
spec/openstack-db_spec.rb View File

@@ -21,7 +21,7 @@ describe 'openstack-ops-database::openstack-db' do
21 21
         'network' => 'neutron',
22 22
         'object-storage' => 'swift',
23 23
         'orchestration' => 'heat',
24
-        'telemetry' => 'ceilometer'
24
+        'telemetry' => 'ceilometer',
25 25
       }.each do |service, _project|
26 26
         expect(chef_run).to create_openstack_common_database(service)
27 27
           .with(user: node['openstack']['db'][service]['username'],

+ 2
- 2
spec/spec_helper.rb View File

@@ -8,12 +8,12 @@ LOG_LEVEL = :fatal
8 8
 REDHAT_OPTS = {
9 9
   platform: 'redhat',
10 10
   version: '7.1',
11
-  log_level: ::LOG_LEVEL
11
+  log_level: ::LOG_LEVEL,
12 12
 }.freeze
13 13
 UBUNTU_OPTS = {
14 14
   platform: 'ubuntu',
15 15
   version: '16.04',
16
-  log_level: ::LOG_LEVEL
16
+  log_level: ::LOG_LEVEL,
17 17
 }.freeze
18 18
 
19 19
 shared_context 'database-stubs' do

Loading…
Cancel
Save