Browse Source

Style and lint fixes to support newer ChefDK

Change-Id: I7b8521a85bace612911f967fe4e35269b7b47034
Depends-On: I6ce4587caa3ae68ddbd3ef1a521aaf46f4840b2c
Samuel Cassiba 2 years ago
parent
commit
57042a006e
7 changed files with 24 additions and 18 deletions
  1. 3
    0
      .rubocop.yml
  2. 1
    1
      README.md
  3. 2
    0
      metadata.rb
  4. 6
    5
      recipes/mariadb-server.rb
  5. 5
    5
      recipes/mysql-server.rb
  6. 5
    5
      recipes/postgresql-server.rb
  7. 2
    2
      spec/spec_helper.rb

+ 3
- 0
.rubocop.yml View File

@@ -23,6 +23,9 @@ Encoding:
23 23
 NumericLiterals:
24 24
   Enabled: false
25 25
 
26
+StringLiterals:
27
+  Enabled: false
28
+
26 29
 LineLength:
27 30
   Enabled: false
28 31
 

+ 1
- 1
README.md View File

@@ -4,7 +4,7 @@ This cookbook provides a reference example of database configuration for the Ope
4 4
 
5 5
 # Requirements #
6 6
 
7
-Chef 11 with Ruby 1.9.x required.
7
+ChefDK 0.15.15 with Ruby 2.1.x required.
8 8
 
9 9
 # Platforms #
10 10
 

+ 2
- 0
metadata.rb View File

@@ -1,6 +1,8 @@
1 1
 name 'openstack-ops-database'
2 2
 maintainer 'openstack-chef'
3 3
 maintainer_email 'openstack-dev@lists.openstack.org'
4
+issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url)
5
+source_url 'https://github.com/openstack/cookbook-openstack-ops-database' if respond_to?(:source_url)
4 6
 license 'Apache 2.0'
5 7
 description 'Provides the shared database configuration for Chef for OpenStack.'
6 8
 version '14.0.0'

+ 6
- 5
recipes/mariadb-server.rb View File

@@ -21,11 +21,12 @@ class ::Chef::Recipe # rubocop:disable Documentation
21 21
 end
22 22
 
23 23
 bind_db = node['openstack']['bind_service']['db']
24
-if bind_db['interface']
25
-  listen_address = address_for bind_db['interface']
26
-else
27
-  listen_address = bind_db['host']
28
-end
24
+
25
+listen_address = if bind_db['interface']
26
+                   address_for bind_db['interface']
27
+                 else
28
+                   bind_db['host']
29
+                 end
29 30
 
30 31
 super_password = get_password 'db', node['openstack']['db']['root_user_key']
31 32
 

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

@@ -25,11 +25,11 @@ class ::Chef::Recipe # rubocop:disable Documentation
25 25
 end
26 26
 
27 27
 bind_db = node['openstack']['bind_service']['db']
28
-if bind_db['interface']
29
-  listen_address = address_for bind_db['interface']
30
-else
31
-  listen_address = bind_db['host']
32
-end
28
+listen_address = if bind_db['interface']
29
+                   address_for bind_db['interface']
30
+                 else
31
+                   listen_address = bind_db['host']
32
+                 end
33 33
 
34 34
 super_password = get_password 'db', node['openstack']['db']['root_user_key']
35 35
 

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

@@ -26,11 +26,11 @@ class ::Chef::Recipe # rubocop:disable Documentation
26 26
 end
27 27
 
28 28
 bind_db = node['openstack']['bind_service']['db']
29
-if bind_db['interface']
30
-  listen_address = address_for bind_db['interface']
31
-else
32
-  listen_address = bind_db['host']
33
-end
29
+listen_address = if bind_db['interface']
30
+                   address_for bind_db['interface']
31
+                 else
32
+                   bind_db['host']
33
+                 end
34 34
 
35 35
 node.override['postgresql']['config']['listen_addresses'] = listen_address
36 36
 

+ 2
- 2
spec/spec_helper.rb View File

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

Loading…
Cancel
Save