Browse Source

Reordered metadata.rb for readability, satisfy foodcritic/rubocop

Change-Id: Ib1a753696982f2e3cce133bd6bd56c4c8fa25bc5
Samuel Cassiba 1 year ago
parent
commit
df79bb4fe9
4 changed files with 25 additions and 18 deletions
  1. 6
    1
      .rubocop_todo.yml
  2. 9
    8
      metadata.rb
  3. 4
    4
      recipes/common.rb
  4. 6
    5
      spec/spec_helper.rb

+ 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:37 +0100 using RuboCop version 0.39.0.
3
+# on 2017-08-17 17:38:41 -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: 7
10
+# Configuration parameters: CountComments, ExcludedMethods.
11
+Metrics/BlockLength:
12
+  Max: 109
13
+
9 14
 # Offense count: 2
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-orchestration'
3
-maintainer 'openstack-chef'
1
+name             'openstack-orchestration'
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-orchestration' if respond_to?(:source_url)
7
-license 'Apache 2.0'
8
-description 'Installs and configures the Heat Service'
4
+license          'Apache 2.0'
5
+description      'Installs and configures the Heat Service'
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-orchestration' if respond_to?(:source_url)
19
+chef_version '>= 12.5' if respond_to?(:chef_version)

+ 4
- 4
recipes/common.rb View File

@@ -105,14 +105,14 @@ heat_conf_options = merge_config_options 'orchestration'
105 105
 directory '/etc/heat' do
106 106
   owner node['openstack']['orchestration']['user']
107 107
   group node['openstack']['orchestration']['group']
108
-  mode 00750
108
+  mode 0o0750
109 109
   action :create
110 110
 end
111 111
 
112 112
 directory '/etc/heat/environment.d' do
113 113
   owner node['openstack']['orchestration']['user']
114 114
   group node['openstack']['orchestration']['group']
115
-  mode 00750
115
+  mode 0o0750
116 116
   action :create
117 117
 end
118 118
 
@@ -121,7 +121,7 @@ template '/etc/heat/heat.conf' do
121 121
   cookbook 'openstack-common'
122 122
   owner node['openstack']['orchestration']['user']
123 123
   group node['openstack']['orchestration']['group']
124
-  mode 00640
124
+  mode 0o0640
125 125
   variables(
126 126
     service_config: heat_conf_options
127 127
   )
@@ -131,7 +131,7 @@ template '/etc/heat/environment.d/default.yaml' do
131 131
   source 'default.yaml.erb'
132 132
   owner node['openstack']['orchestration']['user']
133 133
   group node['openstack']['orchestration']['group']
134
-  mode 00644
134
+  mode 0o0644
135 135
 end
136 136
 
137 137
 execute 'heat-manage db_sync' do

+ 6
- 5
spec/spec_helper.rb View File

@@ -94,7 +94,7 @@ shared_examples 'expects to create heat directories' do
94 94
     expect(chef_run).to create_directory('/etc/heat').with(
95 95
       owner: 'heat',
96 96
       group: 'heat',
97
-      mode: 0750
97
+      mode: 0o750
98 98
     )
99 99
   end
100 100
 
@@ -102,7 +102,7 @@ shared_examples 'expects to create heat directories' do
102 102
     expect(chef_run).to create_directory('/etc/heat/environment.d').with(
103 103
       owner: 'heat',
104 104
       group: 'heat',
105
-      mode: 0750
105
+      mode: 0o750
106 106
     )
107 107
   end
108 108
 end
@@ -115,7 +115,7 @@ shared_examples 'expects to create heat conf' do
115 115
       expect(chef_run).to create_template(file.name).with(
116 116
         owner: 'heat',
117 117
         group: 'heat',
118
-        mode: 0640
118
+        mode: 0o640
119 119
       )
120 120
     end
121 121
 
@@ -173,7 +173,8 @@ shared_examples 'expects to create heat conf' do
173 173
 
174 174
       it 'sets database connection value' do
175 175
         expect(chef_run).to render_config_file(file.name).with_section_content(
176
-          'database', %r{^connection = mysql://heat:heat@127.0.0.1:3306/heat\?charset=utf8$})
176
+          'database', %r{^connection = mysql\+pymysql://heat:heat@127.0.0.1:3306/heat\?charset=utf8$}
177
+        )
177 178
       end
178 179
     end
179 180
 
@@ -239,7 +240,7 @@ shared_examples 'expects to create heat default.yaml' do
239 240
       expect(chef_run).to create_template(file.name).with(
240 241
         owner: 'heat',
241 242
         group: 'heat',
242
-        mode: 0644
243
+        mode: 0o644
243 244
       )
244 245
     end
245 246
   end

Loading…
Cancel
Save