summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Cassiba <s@cassiba.com>2017-08-02 02:01:00 -0400
committerSamuel Cassiba <s@cassiba.com>2017-08-10 17:50:31 -0400
commit76ee6952af892f5d7ea538a02b0f68ad1af38bd5 (patch)
treee5079f7f1a1328df990507778a1b209ef2711590
parent5578a44ee7496a6a3a8172fb2dd9873256d2cbf0 (diff)
Style and lint fixes for chefdk, deprecated Gemfile
- Style and lint fixes for newer chefdk - Removed ancient Gemfile - Rewrote metadata.rb for readability Change-Id: Iba9ba7110dfde7635edc6706ecbbafbdbb161002
Notes
Notes (review): Code-Review+2: Christoph Albers <c.albers@x-ion.de> Code-Review+1: Bogdan Katynski <bogdan.katynski@workday.com> Workflow+1: Jan Klare <j.klare@cloudbau.de> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 11 Aug 2017 15:44:43 +0000 Reviewed-on: https://review.openstack.org/489871 Project: openstack/cookbook-openstack-telemetry Branch: refs/heads/master
-rw-r--r--.rubocop_todo.yml7
-rw-r--r--Gemfile14
-rw-r--r--metadata.rb17
-rw-r--r--recipes/api.rb4
-rw-r--r--recipes/common.rb6
-rw-r--r--recipes/gnocchi_configure.rb12
-rw-r--r--spec/api_spec.rb4
-rw-r--r--spec/common_spec.rb6
-rw-r--r--spec/gnocchi_configure_spec.rb18
9 files changed, 41 insertions, 47 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index bddcba9..9091cc0 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,11 +1,16 @@
1# This configuration was generated by 1# This configuration was generated by
2# `rubocop --auto-gen-config` 2# `rubocop --auto-gen-config`
3# on 2017-02-23 16:58:38 +0100 using RuboCop version 0.39.0. 3# on 2017-08-02 02:00:35 -0400 using RuboCop version 0.47.1.
4# The point is for the user to remove these configuration records 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. 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 6# Note that changes in the inspected code, or installation of new
7# versions of RuboCop, may require this file to be generated again. 7# versions of RuboCop, may require this file to be generated again.
8 8
9# Offense count: 20
10# Configuration parameters: CountComments, ExcludedMethods.
11Metrics/BlockLength:
12 Max: 208
13
9# Offense count: 4 14# Offense count: 4
10# Configuration parameters: EnforcedStyle, SupportedStyles. 15# Configuration parameters: EnforcedStyle, SupportedStyles.
11# SupportedStyles: nested, compact 16# SupportedStyles: nested, compact
diff --git a/Gemfile b/Gemfile
deleted file mode 100644
index 31c90b5..0000000
--- a/Gemfile
+++ /dev/null
@@ -1,14 +0,0 @@
1## THIS GEMFILE IS DEPRECATED AND WILL BE REMOVED AFTER THE NEXT RELEASE
2## THERE WON'T BE ANY UPDATES TO THIS FILE DURING THIS RELEASE CYCLE
3## WE SWITCHED TO CHEFDK AS THE BUNDLE FOR THE NEEDED GEMS
4
5source 'https://rubygems.org'
6
7gem 'chef', '~> 11.18.6'
8gem 'json', '<= 1.7.7' # chef 11 dependency
9gem 'berkshelf', '~> 3.2.1'
10gem 'hashie', '~> 2.0'
11gem 'chefspec', '~> 4.0.0'
12gem 'rspec', '~> 3.0.0'
13gem 'foodcritic', '~> 4.0'
14gem 'rubocop', '~> 0.29.1'
diff --git a/metadata.rb b/metadata.rb
index de6a5bd..4a8996e 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -1,12 +1,10 @@
1name 'openstack-telemetry' 1name 'openstack-telemetry'
2maintainer 'openstack-chef' 2maintainer 'openstack-chef'
3maintainer_email 'openstack-dev@lists.openstack.org' 3maintainer_email 'openstack-dev@lists.openstack.org'
4issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url) 4license 'Apache 2.0'
5source_url 'https://github.com/openstack/cookbook-openstack-telemetry' if respond_to?(:source_url) 5description 'The OpenStack Metering service Ceilometer.'
6license 'Apache 2.0'
7description 'The OpenStack Metering service Ceilometer.'
8long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) 6long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
9version '15.0.0' 7version '15.0.0'
10 8
11recipe 'openstack-telemetry::agent-central', 'Installs agent central service.' 9recipe 'openstack-telemetry::agent-central', 'Installs agent central service.'
12recipe 'openstack-telemetry::agent-compute', 'Installs agent compute service.' 10recipe 'openstack-telemetry::agent-compute', 'Installs agent compute service.'
@@ -26,4 +24,9 @@ end
26depends 'openstack-common', '>= 15.0.0' 24depends 'openstack-common', '>= 15.0.0'
27depends 'openstack-identity', '>= 15.0.0' 25depends 'openstack-identity', '>= 15.0.0'
28depends 'openstackclient' 26depends 'openstackclient'
27
29depends 'apache2', '~> 3.2' 28depends 'apache2', '~> 3.2'
29
30issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url)
31source_url 'https://github.com/openstack/cookbook-openstack-telemetry' if respond_to?(:source_url)
32chef_version '>= 12.5' if respond_to?(:chef_version)
diff --git a/recipes/api.rb b/recipes/api.rb
index 4985acc..f2921bf 100644
--- a/recipes/api.rb
+++ b/recipes/api.rb
@@ -65,7 +65,7 @@ ceilometer_apache_dir = "#{node['apache']['docroot_dir']}/ceilometer"
65directory ceilometer_apache_dir do 65directory ceilometer_apache_dir do
66 owner 'root' 66 owner 'root'
67 group 'root' 67 group 'root'
68 mode 00755 68 mode 0o0755
69end 69end
70 70
71ceilometer_server_entry = "#{ceilometer_apache_dir}/app" 71ceilometer_server_entry = "#{ceilometer_apache_dir}/app"
@@ -75,7 +75,7 @@ file ceilometer_server_entry do
75 content lazy { IO.read(platform['ceilometer-api_wsgi_file']) } 75 content lazy { IO.read(platform['ceilometer-api_wsgi_file']) }
76 owner 'root' 76 owner 'root'
77 group 'root' 77 group 'root'
78 mode 00755 78 mode 0o0755
79end 79end
80 80
81web_app 'ceilometer-api' do 81web_app 'ceilometer-api' do
diff --git a/recipes/common.rb b/recipes/common.rb
index f8ec4b1..e77cebb 100644
--- a/recipes/common.rb
+++ b/recipes/common.rb
@@ -82,14 +82,14 @@ end
82directory node['openstack']['telemetry']['conf_dir'] do 82directory node['openstack']['telemetry']['conf_dir'] do
83 owner node['openstack']['telemetry']['user'] 83 owner node['openstack']['telemetry']['user']
84 group node['openstack']['telemetry']['group'] 84 group node['openstack']['telemetry']['group']
85 mode 00750 85 mode 0o0750
86 action :create 86 action :create
87end 87end
88 88
89directory "#{node['apache']['run_dir']}/ceilometer" do 89directory "#{node['apache']['run_dir']}/ceilometer" do
90 owner node['openstack']['telemetry']['user'] 90 owner node['openstack']['telemetry']['user']
91 group node['openstack']['telemetry']['group'] 91 group node['openstack']['telemetry']['group']
92 mode 00750 92 mode 0o0750
93 recursive true 93 recursive true
94 action :create 94 action :create
95end 95end
@@ -102,7 +102,7 @@ template node['openstack']['telemetry']['conf_file'] do
102 cookbook 'openstack-common' 102 cookbook 'openstack-common'
103 owner node['openstack']['telemetry']['user'] 103 owner node['openstack']['telemetry']['user']
104 group node['openstack']['telemetry']['group'] 104 group node['openstack']['telemetry']['group']
105 mode 00640 105 mode 0o0640
106 variables( 106 variables(
107 service_config: ceilometer_conf_options 107 service_config: ceilometer_conf_options
108 ) 108 )
diff --git a/recipes/gnocchi_configure.rb b/recipes/gnocchi_configure.rb
index 821ffaa..99cb7f1 100644
--- a/recipes/gnocchi_configure.rb
+++ b/recipes/gnocchi_configure.rb
@@ -54,7 +54,7 @@ template node['openstack']['telemetry-metric']['conf_file'] do
54 cookbook 'openstack-common' 54 cookbook 'openstack-common'
55 owner node['openstack']['telemetry-metric']['user'] 55 owner node['openstack']['telemetry-metric']['user']
56 group node['openstack']['telemetry-metric']['group'] 56 group node['openstack']['telemetry-metric']['group']
57 mode 00640 57 mode 0o0640
58 variables( 58 variables(
59 service_config: gnocchi_conf_options 59 service_config: gnocchi_conf_options
60 ) 60 )
@@ -66,7 +66,7 @@ cookbook_file File.join(node['openstack']['telemetry']['conf_dir'], 'gnocchi_res
66 source 'gnocchi_resources.yaml' 66 source 'gnocchi_resources.yaml'
67 owner node['openstack']['telemetry']['user'] 67 owner node['openstack']['telemetry']['user']
68 group node['openstack']['telemetry']['group'] 68 group node['openstack']['telemetry']['group']
69 mode 00640 69 mode 0o0640
70end 70end
71 71
72# drop api-paste.ini to gnocchi folder (default ini will not use keystone auth) 72# drop api-paste.ini to gnocchi folder (default ini will not use keystone auth)
@@ -74,7 +74,7 @@ cookbook_file File.join(node['openstack']['telemetry-metric']['conf_dir'], 'api-
74 source 'api-paste.ini' 74 source 'api-paste.ini'
75 owner node['openstack']['telemetry-metric']['user'] 75 owner node['openstack']['telemetry-metric']['user']
76 group node['openstack']['telemetry-metric']['group'] 76 group node['openstack']['telemetry-metric']['group']
77 mode 00640 77 mode 0o0640
78end 78end
79 79
80if node['openstack']['telemetry-metric']['conf']['storage']['driver'] == 'file' 80if node['openstack']['telemetry-metric']['conf']['storage']['driver'] == 'file'
@@ -87,7 +87,7 @@ if node['openstack']['telemetry-metric']['conf']['storage']['driver'] == 'file'
87 owner node['openstack']['telemetry-metric']['user'] 87 owner node['openstack']['telemetry-metric']['user']
88 group node['openstack']['telemetry-metric']['group'] 88 group node['openstack']['telemetry-metric']['group']
89 recursive true 89 recursive true
90 mode 00750 90 mode 0o0750
91 end 91 end
92 end 92 end
93end 93end
@@ -119,7 +119,7 @@ gnocchi_apache_dir = "#{node['apache']['docroot_dir']}/gnocchi"
119directory gnocchi_apache_dir do 119directory gnocchi_apache_dir do
120 owner 'root' 120 owner 'root'
121 group 'root' 121 group 'root'
122 mode 00755 122 mode 0o0755
123end 123end
124 124
125gnocchi_server_entry = "#{gnocchi_apache_dir}/app" 125gnocchi_server_entry = "#{gnocchi_apache_dir}/app"
@@ -129,7 +129,7 @@ file gnocchi_server_entry do
129 content lazy { IO.read(platform['gnocchi-api_wsgi_file']) } 129 content lazy { IO.read(platform['gnocchi-api_wsgi_file']) }
130 owner 'root' 130 owner 'root'
131 group 'root' 131 group 'root'
132 mode 00755 132 mode 0o0755
133end 133end
134 134
135web_app 'gnocchi-api' do 135web_app 'gnocchi-api' do
diff --git a/spec/api_spec.rb b/spec/api_spec.rb
index 21f97d2..8a8ddf6 100644
--- a/spec/api_spec.rb
+++ b/spec/api_spec.rb
@@ -35,7 +35,7 @@ describe 'openstack-telemetry::api' do
35 expect(chef_run).to create_directory('/var/www/html/ceilometer').with( 35 expect(chef_run).to create_directory('/var/www/html/ceilometer').with(
36 user: 'root', 36 user: 'root',
37 group: 'root', 37 group: 'root',
38 mode: 00755 38 mode: 0o0755
39 ) 39 )
40 end 40 end
41 41
@@ -43,7 +43,7 @@ describe 'openstack-telemetry::api' do
43 expect(chef_run).to create_file('/var/www/html/ceilometer/app').with( 43 expect(chef_run).to create_file('/var/www/html/ceilometer/app').with(
44 user: 'root', 44 user: 'root',
45 group: 'root', 45 group: 'root',
46 mode: 00755 46 mode: 0o0755
47 ) 47 )
48 end 48 end
49 49
diff --git a/spec/common_spec.rb b/spec/common_spec.rb
index d9fdb8f..3f5821b 100644
--- a/spec/common_spec.rb
+++ b/spec/common_spec.rb
@@ -40,7 +40,7 @@ describe 'openstack-telemetry::common' do
40 expect(chef_run).to create_directory(dir.name).with( 40 expect(chef_run).to create_directory(dir.name).with(
41 user: 'ceilometer', 41 user: 'ceilometer',
42 group: 'ceilometer', 42 group: 'ceilometer',
43 mode: 0750 43 mode: 0o750
44 ) 44 )
45 end 45 end
46 end 46 end
@@ -52,7 +52,7 @@ describe 'openstack-telemetry::common' do
52 expect(chef_run).to create_template(file.name).with( 52 expect(chef_run).to create_template(file.name).with(
53 user: 'ceilometer', 53 user: 'ceilometer',
54 group: 'ceilometer', 54 group: 'ceilometer',
55 mode: 0640 55 mode: 0o640
56 ) 56 )
57 end 57 end
58 58
@@ -127,7 +127,7 @@ describe 'openstack-telemetry::common' do
127 expect(chef_run).to render_config_file(file.name) 127 expect(chef_run).to render_config_file(file.name)
128 .with_section_content( 128 .with_section_content(
129 'database', 129 'database',
130 %r{^connection = mysql://ceilometer:ceilometer-dbpass@127\.0\.0\.1:3306/ceilometer\?charset=utf8$} 130 %(connection = mysql+pymysql://ceilometer:ceilometer-dbpass@127.0.0.1:3306/ceilometer?charset=utf8)
131 ) 131 )
132 end 132 end
133 end 133 end
diff --git a/spec/gnocchi_configure_spec.rb b/spec/gnocchi_configure_spec.rb
index 277e844..ae4198a 100644
--- a/spec/gnocchi_configure_spec.rb
+++ b/spec/gnocchi_configure_spec.rb
@@ -15,7 +15,7 @@ describe 'openstack-telemetry::gnocchi_configure' do
15 expect(chef_run).to create_template(file.name).with( 15 expect(chef_run).to create_template(file.name).with(
16 user: 'gnocchi', 16 user: 'gnocchi',
17 group: 'gnocchi', 17 group: 'gnocchi',
18 mode: 0640 18 mode: 0o640
19 ) 19 )
20 end 20 end
21 21
@@ -49,7 +49,7 @@ describe 'openstack-telemetry::gnocchi_configure' do
49 expect(chef_run).to render_config_file(file.name) 49 expect(chef_run).to render_config_file(file.name)
50 .with_section_content( 50 .with_section_content(
51 'database', 51 'database',
52 %r{^connection = mysql://gnocchi:gnocchi-dbpass@127\.0\.0\.1:3306/gnocchi\?charset=utf8$} 52 %(connection = mysql+pymysql://gnocchi:gnocchi-dbpass@127.0.0.1:3306/gnocchi?charset=utf8)
53 ) 53 )
54 end 54 end
55 55
@@ -57,7 +57,7 @@ describe 'openstack-telemetry::gnocchi_configure' do
57 expect(chef_run).to render_config_file(file.name) 57 expect(chef_run).to render_config_file(file.name)
58 .with_section_content( 58 .with_section_content(
59 'indexer', 59 'indexer',
60 %r{^url = mysql://gnocchi:gnocchi-dbpass@127\.0\.0\.1:3306/gnocchi\?charset=utf8$} 60 %(url = mysql+pymysql://gnocchi:gnocchi-dbpass@127.0.0.1:3306/gnocchi?charset=utf8)
61 ) 61 )
62 end 62 end
63 end 63 end
@@ -68,7 +68,7 @@ describe 'openstack-telemetry::gnocchi_configure' do
68 source: 'gnocchi_resources.yaml', 68 source: 'gnocchi_resources.yaml',
69 owner: 'ceilometer', 69 owner: 'ceilometer',
70 group: 'ceilometer', 70 group: 'ceilometer',
71 mode: 00640 71 mode: 0o0640
72 ) 72 )
73 end 73 end
74 74
@@ -78,7 +78,7 @@ describe 'openstack-telemetry::gnocchi_configure' do
78 source: 'api-paste.ini', 78 source: 'api-paste.ini',
79 owner: 'gnocchi', 79 owner: 'gnocchi',
80 group: 'gnocchi', 80 group: 'gnocchi',
81 mode: 00640 81 mode: 0o0640
82 ) 82 )
83 end 83 end
84 84
@@ -90,7 +90,7 @@ describe 'openstack-telemetry::gnocchi_configure' do
90 .with( 90 .with(
91 user: 'gnocchi', 91 user: 'gnocchi',
92 group: 'gnocchi', 92 group: 'gnocchi',
93 mode: 0750 93 mode: 0o750
94 ) 94 )
95 end 95 end
96 end 96 end
@@ -103,7 +103,7 @@ describe 'openstack-telemetry::gnocchi_configure' do
103 .with( 103 .with(
104 user: 'gnocchi', 104 user: 'gnocchi',
105 group: 'gnocchi', 105 group: 'gnocchi',
106 mode: 0750 106 mode: 0o750
107 ) 107 )
108 end 108 end
109 end 109 end
@@ -143,7 +143,7 @@ describe 'openstack-telemetry::gnocchi_configure' do
143 expect(chef_run).to create_directory('/var/www/html/gnocchi').with( 143 expect(chef_run).to create_directory('/var/www/html/gnocchi').with(
144 user: 'root', 144 user: 'root',
145 group: 'root', 145 group: 'root',
146 mode: 00755 146 mode: 0o0755
147 ) 147 )
148 end 148 end
149 149
@@ -151,7 +151,7 @@ describe 'openstack-telemetry::gnocchi_configure' do
151 expect(chef_run).to create_file('/var/www/html/gnocchi/app').with( 151 expect(chef_run).to create_file('/var/www/html/gnocchi/app').with(
152 user: 'root', 152 user: 'root',
153 group: 'root', 153 group: 'root',
154 mode: 00755 154 mode: 0o0755
155 ) 155 )
156 end 156 end
157 157