summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Cassiba <s@cassiba.com>2017-08-23 22:38:10 -0400
committerSamuel Cassiba <s@cassiba.com>2017-08-25 10:08:57 -0400
commit032dd3c51af5c5f87b864a9bfdba0948b4f76eee (patch)
tree48c0ced847a2656b15b8e048ad1128861e483e3a
parent1a46445152b5af6c62b0358b01dcf86e90e1e8f1 (diff)
Initial orchestration Pike updates
- Switched default linter to cookstyle - Renamed rake tasks to better conform with Chef conventions - Normalized template banner Change-Id: Icc3eca4b2d17a6d1ef66c1c7e75513de0ee3cac9
Notes
Notes (review): Code-Review+2: Jan Klare <j.klare@cloudbau.de> Workflow+1: Christoph Albers <c.albers@x-ion.de> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 11 Sep 2017 08:48:24 +0000 Reviewed-on: https://review.openstack.org/496987 Project: openstack/cookbook-openstack-orchestration Branch: refs/heads/master
-rw-r--r--.rubocop.yml2
-rw-r--r--.rubocop_todo.yml20
-rw-r--r--Rakefile14
-rw-r--r--attributes/default.rb8
-rw-r--r--recipes/common.rb2
-rw-r--r--recipes/identity_registration.rb4
-rw-r--r--spec/identity_registration_spec.rb2
-rw-r--r--spec/spec_helper.rb22
8 files changed, 26 insertions, 48 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 5e0be9f..253be24 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,5 +1,3 @@
1inherit_from: .rubocop_todo.yml
2
3AllCops: 1AllCops:
4 Include: 2 Include:
5 - metadata.rb 3 - metadata.rb
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
deleted file mode 100644
index 1303559..0000000
--- a/.rubocop_todo.yml
+++ /dev/null
@@ -1,20 +0,0 @@
1# This configuration was generated by
2# `rubocop --auto-gen-config`
3# on 2017-08-18 10:09:13 +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: 7
10# Configuration parameters: CountComments, ExcludedMethods.
11Metrics/BlockLength:
12 Max: 109
13
14# Offense count: 2
15# Configuration parameters: EnforcedStyle, SupportedStyles.
16# SupportedStyles: nested, compact
17Style/ClassAndModuleChildren:
18 Exclude:
19 - 'recipes/common.rb'
20 - 'recipes/identity_registration.rb'
diff --git a/Rakefile b/Rakefile
index 676e7d4..c9edb13 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,20 +1,20 @@
1task default: ["test"] 1task default: ["test"]
2 2
3task :test => [:lint, :style, :unit] 3task :test => [:syntax, :lint, :unit]
4 4
5desc "Vendor the cookbooks in the Berksfile" 5desc "Vendor the cookbooks in the Berksfile"
6task :berks_prep do 6task :berks_prep do
7 sh %{chef exec berks vendor} 7 sh %{chef exec berks vendor}
8end 8end
9 9
10desc "Run FoodCritic (lint) tests" 10desc "Run FoodCritic (syntax) tests"
11task :lint do 11task :syntax do
12 sh %{chef exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .} 12 sh %{chef exec foodcritic --exclude spec -f any .}
13end 13end
14 14
15desc "Run RuboCop (style) tests" 15desc "Run RuboCop (lint) tests"
16task :style do 16task :lint do
17 sh %{chef exec rubocop} 17 sh %{chef exec cookstyle}
18end 18end
19 19
20desc "Run RSpec (unit) tests" 20desc "Run RSpec (unit) tests"
diff --git a/attributes/default.rb b/attributes/default.rb
index 4758985..d20338e 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -44,8 +44,8 @@ default['openstack']['bind_service']['all']['orchestration-api-cloudwatch']['por
44# Set to some text value if you want templated config files 44# Set to some text value if you want templated config files
45# to contain a custom banner at the top of the written file 45# to contain a custom banner at the top of the written file
46default['openstack']['orchestration']['custom_template_banner'] = ' 46default['openstack']['orchestration']['custom_template_banner'] = '
47# This file was autogenerated by Chef 47# This file is automatically generated by Chef
48# Do not edit, changes will be overwritten 48# Any changes will be overwritten
49' 49'
50 50
51default['openstack']['orchestration']['syslog']['use'] 51default['openstack']['orchestration']['syslog']['use']
@@ -78,7 +78,7 @@ when 'rhel'
78 'heat_engine_packages' => ['openstack-heat-engine'], 78 'heat_engine_packages' => ['openstack-heat-engine'],
79 'heat_engine_service' => 'openstack-heat-engine', 79 'heat_engine_service' => 'openstack-heat-engine',
80 'heat_api_process_name' => 'heat-api', 80 'heat_api_process_name' => 'heat-api',
81 'package_overrides' => '' 81 'package_overrides' => '',
82 } 82 }
83when 'debian' 83when 'debian'
84 default['openstack']['orchestration']['user'] = 'heat' 84 default['openstack']['orchestration']['user'] = 'heat'
@@ -93,6 +93,6 @@ when 'debian'
93 'heat_api_cloudwatch_service' => 'heat-api-cloudwatch', 93 'heat_api_cloudwatch_service' => 'heat-api-cloudwatch',
94 'heat_engine_packages' => ['heat-engine'], 94 'heat_engine_packages' => ['heat-engine'],
95 'heat_engine_service' => 'heat-engine', 95 'heat_engine_service' => 'heat-engine',
96 'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'" 96 'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'",
97 } 97 }
98end 98end
diff --git a/recipes/common.rb b/recipes/common.rb
index 9eb35ff..3548dc1 100644
--- a/recipes/common.rb
+++ b/recipes/common.rb
@@ -19,7 +19,7 @@
19# limitations under the License. 19# limitations under the License.
20# 20#
21 21
22class ::Chef::Recipe # rubocop:disable Documentation 22class ::Chef::Recipe
23 include ::Openstack 23 include ::Openstack
24end 24end
25 25
diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb
index 87e8228..9e2d526 100644
--- a/recipes/identity_registration.rb
+++ b/recipes/identity_registration.rb
@@ -20,7 +20,7 @@
20 20
21require 'uri' 21require 'uri'
22 22
23class ::Chef::Recipe # rubocop:disable Documentation 23class ::Chef::Recipe
24 include ::Openstack 24 include ::Openstack
25end 25end
26 26
@@ -56,7 +56,7 @@ connection_params = {
56 openstack_username: admin_user, 56 openstack_username: admin_user,
57 openstack_api_key: admin_pass, 57 openstack_api_key: admin_pass,
58 openstack_project_name: admin_project, 58 openstack_project_name: admin_project,
59 openstack_domain_name: admin_domain 59 openstack_domain_name: admin_domain,
60} 60}
61 61
62# Register Orchestration Service 62# Register Orchestration Service
diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb
index 3f42030..97f1ab4 100644
--- a/spec/identity_registration_spec.rb
+++ b/spec/identity_registration_spec.rb
@@ -14,7 +14,7 @@ describe 'openstack-orchestration::identity_registration' do
14 openstack_username: 'admin', 14 openstack_username: 'admin',
15 openstack_api_key: 'admin-pass', 15 openstack_api_key: 'admin-pass',
16 openstack_project_name: 'admin', 16 openstack_project_name: 'admin',
17 openstack_domain_name: 'default' 17 openstack_domain_name: 'default',
18 } 18 }
19 service_name = 'heat' 19 service_name = 'heat'
20 service_type = 'orchestration' 20 service_type = 'orchestration'
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 229c6d6..89f5a5a 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -10,17 +10,17 @@ LOG_LEVEL = :fatal
10REDHAT_OPTS = { 10REDHAT_OPTS = {
11 platform: 'redhat', 11 platform: 'redhat',
12 version: '7.1', 12 version: '7.1',
13 log_level: ::LOG_LEVEL 13 log_level: ::LOG_LEVEL,
14}.freeze 14}.freeze
15UBUNTU_OPTS = { 15UBUNTU_OPTS = {
16 platform: 'ubuntu', 16 platform: 'ubuntu',
17 version: '16.04', 17 version: '16.04',
18 log_level: ::LOG_LEVEL 18 log_level: ::LOG_LEVEL,
19}.freeze 19}.freeze
20SUSE_OPTS = { 20SUSE_OPTS = {
21 platform: 'suse', 21 platform: 'suse',
22 version: '11.3', 22 version: '11.3',
23 log_level: ::LOG_LEVEL 23 log_level: ::LOG_LEVEL,
24}.freeze 24}.freeze
25 25
26shared_context 'orchestration_stubs' do 26shared_context 'orchestration_stubs' do
@@ -130,7 +130,7 @@ shared_examples 'expects to create heat conf' do
130 %r{^heat_waitcondition_server_url = http://127.0.0.1:8000/v1/waitcondition$}, 130 %r{^heat_waitcondition_server_url = http://127.0.0.1:8000/v1/waitcondition$},
131 %r{^heat_watch_server_url = http://127.0.0.1:8003$}, 131 %r{^heat_watch_server_url = http://127.0.0.1:8003$},
132 %r{^log_dir = /var/log/heat$}, 132 %r{^log_dir = /var/log/heat$},
133 /^region_name_for_services = RegionOne$/ 133 /^region_name_for_services = RegionOne$/,
134 ].each do |line| 134 ].each do |line|
135 expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line) 135 expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line)
136 end 136 end
@@ -138,7 +138,7 @@ shared_examples 'expects to create heat conf' do
138 138
139 it 'has oslo_messaging_notifications conf values' do 139 it 'has oslo_messaging_notifications conf values' do
140 [ 140 [
141 /^driver = heat.openstack.common.notifier.rpc_notifier$/ 141 /^driver = heat.openstack.common.notifier.rpc_notifier$/,
142 ].each do |line| 142 ].each do |line|
143 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_notifications', line) 143 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_notifications', line)
144 end 144 end
@@ -147,7 +147,7 @@ shared_examples 'expects to create heat conf' do
147 it 'has heat_api binding' do 147 it 'has heat_api binding' do
148 [ 148 [
149 /^bind_host = 127.0.0.1$/, 149 /^bind_host = 127.0.0.1$/,
150 /^bind_port = 8004$/ 150 /^bind_port = 8004$/,
151 ].each do |line| 151 ].each do |line|
152 expect(chef_run).to render_config_file(file.name).with_section_content('heat_api', line) 152 expect(chef_run).to render_config_file(file.name).with_section_content('heat_api', line)
153 end 153 end
@@ -156,7 +156,7 @@ shared_examples 'expects to create heat conf' do
156 it 'has heat_api_cfn binding' do 156 it 'has heat_api_cfn binding' do
157 [ 157 [
158 /^bind_host = 127.0.0.1$/, 158 /^bind_host = 127.0.0.1$/,
159 /^bind_port = 8000$/ 159 /^bind_port = 8000$/,
160 ].each do |line| 160 ].each do |line|
161 expect(chef_run).to render_config_file(file.name).with_section_content('heat_api_cfn', line) 161 expect(chef_run).to render_config_file(file.name).with_section_content('heat_api_cfn', line)
162 end 162 end
@@ -165,7 +165,7 @@ shared_examples 'expects to create heat conf' do
165 it 'has heat_api_cloudwatch binding' do 165 it 'has heat_api_cloudwatch binding' do
166 [ 166 [
167 /^bind_host = 127.0.0.1$/, 167 /^bind_host = 127.0.0.1$/,
168 /^bind_port = 8003$/ 168 /^bind_port = 8003$/,
169 ].each do |line| 169 ].each do |line|
170 expect(chef_run).to render_config_file(file.name).with_section_content('heat_api_cloudwatch', line) 170 expect(chef_run).to render_config_file(file.name).with_section_content('heat_api_cloudwatch', line)
171 end 171 end
@@ -193,7 +193,7 @@ shared_examples 'expects to create heat conf' do
193 describe 'has oslo_messaging_rabbit values' do 193 describe 'has oslo_messaging_rabbit values' do
194 it 'has default rabbit values' do 194 it 'has default rabbit values' do
195 [ 195 [
196 %r{^transport_url = rabbit://guest:mypass@127.0.0.1:5672$} 196 %r{^transport_url = rabbit://guest:mypass@127.0.0.1:5672$},
197 ].each do |line| 197 ].each do |line|
198 expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line) 198 expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line)
199 end 199 end
@@ -209,7 +209,7 @@ shared_examples 'expects to create heat conf' do
209 /^project_name = service$/, 209 /^project_name = service$/,
210 /^user_domain_name = Default/, 210 /^user_domain_name = Default/,
211 /^project_domain_name = Default/, 211 /^project_domain_name = Default/,
212 /^password = heat-pass$/ 212 /^password = heat-pass$/,
213 ].each do |line| 213 ].each do |line|
214 expect(chef_run).to render_config_file(file.name).with_section_content('keystone_authtoken', line) 214 expect(chef_run).to render_config_file(file.name).with_section_content('keystone_authtoken', line)
215 end 215 end
@@ -223,7 +223,7 @@ shared_examples 'expects to create heat conf' do
223 /^auth_plugin = v3password$/, 223 /^auth_plugin = v3password$/,
224 /^username = heat$/, 224 /^username = heat$/,
225 /^password = heat-pass$/, 225 /^password = heat-pass$/,
226 /^user_domain_name = Default$/ 226 /^user_domain_name = Default$/,
227 ].each do |line| 227 ].each do |line|
228 expect(chef_run).to render_config_file(file.name).with_section_content('trustee', line) 228 expect(chef_run).to render_config_file(file.name).with_section_content('trustee', line)
229 end 229 end