summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Cassiba <s@cassiba.com>2017-08-20 10:11:45 -0400
committerSamuel Cassiba <s@cassiba.com>2017-08-25 09:15:49 -0400
commit60a38b538db57ce691c2b66d1588be156d9fa948 (patch)
tree4c044cc48f47e3d05ba72d4076f25aed34fa2336
parenta29984d3012a119e5a2c2b8e292446940000916e (diff)
Initial block-storage Pike updates
- Changed the default linter to cookstyle - cinder-group-active was missing a Provides header for the SysV init script - Switched the qemu package to SCL for CentOS to get a newer release - Normalized template banner comment Change-Id: Iec59e0c8e3cb0b83db92a0a9f8db34a40953351f
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 09:15:14 +0000 Reviewed-on: https://review.openstack.org/495563 Project: openstack/cookbook-openstack-block-storage Branch: refs/heads/master
-rw-r--r--.rubocop.yml2
-rw-r--r--.rubocop_todo.yml22
-rw-r--r--Rakefile14
-rw-r--r--attributes/default.rb10
-rw-r--r--recipes/identity_registration.rb4
-rw-r--r--spec/cinder_common_spec.rb2
-rw-r--r--spec/identity_registration_spec.rb2
-rw-r--r--spec/spec_helper.rb8
-rw-r--r--spec/volume-redhat_spec.rb4
-rw-r--r--templates/default/cinder-group-active.erb1
10 files changed, 23 insertions, 46 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 02f0e90..0000000
--- a/.rubocop_todo.yml
+++ /dev/null
@@ -1,22 +0,0 @@
1# This configuration was generated by
2# `rubocop --auto-gen-config`
3# on 2017-08-17 14:15:59 +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: 18
10# Configuration parameters: CountComments, ExcludedMethods.
11Metrics/BlockLength:
12 Max: 178
13
14# Offense count: 4
15# Configuration parameters: EnforcedStyle, SupportedStyles.
16# SupportedStyles: nested, compact
17Style/ClassAndModuleChildren:
18 Exclude:
19 - 'recipes/api.rb'
20 - 'recipes/cinder-common.rb'
21 - 'recipes/identity_registration.rb'
22 - 'recipes/volume.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 1330791..9c0afff 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -30,8 +30,8 @@ default['developer_mode'] = false # we want secure passwords by default
30# Set to some text value if you want templated config files 30# Set to some text value if you want templated config files
31# to contain a custom banner at the top of the written file 31# to contain a custom banner at the top of the written file
32default['openstack']['block-storage']['custom_template_banner'] = ' 32default['openstack']['block-storage']['custom_template_banner'] = '
33# This file autogenerated by Chef 33# This file is automatically generated by Chef
34# Do not edit, changes will be overwritten 34# Any changes will be overwritten
35' 35'
36 36
37# Specify policy.json remote file to import 37# Specify policy.json remote file to import
@@ -79,7 +79,7 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
79 'cinder_common_packages' => ['openstack-cinder'], 79 'cinder_common_packages' => ['openstack-cinder'],
80 'cinder_api_packages' => ['openstack-cinder'], 80 'cinder_api_packages' => ['openstack-cinder'],
81 'cinder_api_service' => 'openstack-cinder-api', 81 'cinder_api_service' => 'openstack-cinder-api',
82 'cinder_volume_packages' => ['qemu-img'], 82 'cinder_volume_packages' => ['qemu-img-ev'],
83 'cinder_volume_service' => 'openstack-cinder-volume', 83 'cinder_volume_service' => 'openstack-cinder-volume',
84 'cinder_scheduler_packages' => [], 84 'cinder_scheduler_packages' => [],
85 'cinder_scheduler_service' => 'openstack-cinder-scheduler', 85 'cinder_scheduler_service' => 'openstack-cinder-scheduler',
@@ -93,7 +93,7 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
93 'cinder_svc_packages' => ['sysfsutils'], 93 'cinder_svc_packages' => ['sysfsutils'],
94 'cinder_lvm_packages' => ['lvm2'], 94 'cinder_lvm_packages' => ['lvm2'],
95 'cinder_flashsystem_packages' => ['sysfsutils'], 95 'cinder_flashsystem_packages' => ['sysfsutils'],
96 'package_overrides' => '' 96 'package_overrides' => '',
97 } 97 }
98when 'debian' 98when 'debian'
99 # operating system user and group names 99 # operating system user and group names
@@ -115,7 +115,7 @@ when 'debian'
115 'cinder_svc_packages' => ['sysfsutils'], 115 'cinder_svc_packages' => ['sysfsutils'],
116 'cinder_lvm_packages' => ['lvm2'], 116 'cinder_lvm_packages' => ['lvm2'],
117 'cinder_flashsystem_packages' => ['sysfsutils'], 117 'cinder_flashsystem_packages' => ['sysfsutils'],
118 'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'" 118 'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'",
119 } 119 }
120end 120end
121 121
diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb
index 5eb015d..efae88d 100644
--- a/recipes/identity_registration.rb
+++ b/recipes/identity_registration.rb
@@ -32,7 +32,7 @@ auth_url = ::URI.decode identity_admin_endpoint.to_s
32interfaces = { 32interfaces = {
33 public: { url: public_endpoint('block-storage') }, 33 public: { url: public_endpoint('block-storage') },
34 internal: { url: internal_endpoint('block-storage') }, 34 internal: { url: internal_endpoint('block-storage') },
35 admin: { url: admin_endpoint('block-storage') } 35 admin: { url: admin_endpoint('block-storage') },
36} 36}
37service_pass = get_password 'service', 'openstack-block-storage' 37service_pass = get_password 'service', 'openstack-block-storage'
38region = node['openstack']['block-storage']['region'] 38region = node['openstack']['block-storage']['region']
@@ -52,7 +52,7 @@ connection_params = {
52 openstack_username: admin_user, 52 openstack_username: admin_user,
53 openstack_api_key: admin_pass, 53 openstack_api_key: admin_pass,
54 openstack_project_name: admin_project, 54 openstack_project_name: admin_project,
55 openstack_domain_name: admin_domain 55 openstack_domain_name: admin_domain,
56} 56}
57 57
58# Register VolumeV2 Service 58# Register VolumeV2 Service
diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb
index 2a11540..fc43260 100644
--- a/spec/cinder_common_spec.rb
+++ b/spec/cinder_common_spec.rb
@@ -208,7 +208,7 @@ describe 'openstack-block-storage::cinder-common' do
208 %r{^exec_dirs = /sbin,/usr/sbin,/bin,/usr/bin$}, 208 %r{^exec_dirs = /sbin,/usr/sbin,/bin,/usr/bin$},
209 /^use_syslog = false$/, 209 /^use_syslog = false$/,
210 /^syslog_log_facility = syslog$/, 210 /^syslog_log_facility = syslog$/,
211 /^syslog_log_level = ERROR$/ 211 /^syslog_log_level = ERROR$/,
212 ].each do |line| 212 ].each do |line|
213 expect(chef_run).to render_file(file.name).with_content(line) 213 expect(chef_run).to render_file(file.name).with_content(line)
214 end 214 end
diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb
index 162f994..f588379 100644
--- a/spec/identity_registration_spec.rb
+++ b/spec/identity_registration_spec.rb
@@ -17,7 +17,7 @@ describe 'openstack-block-storage::identity_registration' do
17 openstack_username: 'admin', 17 openstack_username: 'admin',
18 openstack_api_key: 'emc_test_pass', 18 openstack_api_key: 'emc_test_pass',
19 openstack_project_name: 'admin', 19 openstack_project_name: 'admin',
20 openstack_domain_name: 'default' 20 openstack_domain_name: 'default',
21 } 21 }
22 service_name = 'cinderv2' 22 service_name = 'cinderv2'
23 service_type = 'volumev2' 23 service_type = 'volumev2'
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 061067c..eb82788 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -13,12 +13,12 @@ LOG_LEVEL = :fatal
13REDHAT_OPTS = { 13REDHAT_OPTS = {
14 platform: 'redhat', 14 platform: 'redhat',
15 version: '7.1', 15 version: '7.1',
16 log_level: LOG_LEVEL 16 log_level: LOG_LEVEL,
17}.freeze 17}.freeze
18UBUNTU_OPTS = { 18UBUNTU_OPTS = {
19 platform: 'ubuntu', 19 platform: 'ubuntu',
20 version: '16.04', 20 version: '16.04',
21 log_level: LOG_LEVEL 21 log_level: LOG_LEVEL,
22}.freeze 22}.freeze
23 23
24shared_context 'block-storage-stubs' do 24shared_context 'block-storage-stubs' do
@@ -116,7 +116,7 @@ shared_examples 'creates_cinder_conf' do |service, user, group, action = :restar
116 /^project_domain_name = Default/, 116 /^project_domain_name = Default/,
117 %r{^auth_uri = http://127.0.0.1:5000/v3$}, 117 %r{^auth_uri = http://127.0.0.1:5000/v3$},
118 %r{^auth_url = http://127.0.0.1:35357/v3$}, 118 %r{^auth_url = http://127.0.0.1:35357/v3$},
119 /^password = cinder-pass$/ 119 /^password = cinder-pass$/,
120 ].each do |line| 120 ].each do |line|
121 expect(chef_run).to render_config_file(file.name) 121 expect(chef_run).to render_config_file(file.name)
122 .with_section_content('keystone_authtoken', line) 122 .with_section_content('keystone_authtoken', line)
@@ -125,7 +125,7 @@ shared_examples 'creates_cinder_conf' do |service, user, group, action = :restar
125 125
126 it 'has oslo_messaging_notifications conf values' do 126 it 'has oslo_messaging_notifications conf values' do
127 [ 127 [
128 /^driver = cinder.openstack.common.notifier.rpc_notifier$/ 128 /^driver = cinder.openstack.common.notifier.rpc_notifier$/,
129 ].each do |line| 129 ].each do |line|
130 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_notifications', line) 130 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_notifications', line)
131 end 131 end
diff --git a/spec/volume-redhat_spec.rb b/spec/volume-redhat_spec.rb
index 60a8fff..1830442 100644
--- a/spec/volume-redhat_spec.rb
+++ b/spec/volume-redhat_spec.rb
@@ -23,8 +23,8 @@ describe 'openstack-block-storage::volume' do
23 expect(chef_run).not_to upgrade_package('MySQL-python') 23 expect(chef_run).not_to upgrade_package('MySQL-python')
24 end 24 end
25 25
26 it 'upgrades qemu img package' do 26 it 'upgrades qemu-img-ev package' do
27 expect(chef_run).to upgrade_package('qemu-img') 27 expect(chef_run).to upgrade_package('qemu-img-ev')
28 end 28 end
29 29
30 it 'upgrades cinder iscsi package' do 30 it 'upgrades cinder iscsi package' do
diff --git a/templates/default/cinder-group-active.erb b/templates/default/cinder-group-active.erb
index 3a7eebb..098703f 100644
--- a/templates/default/cinder-group-active.erb
+++ b/templates/default/cinder-group-active.erb
@@ -7,6 +7,7 @@
7# chkconfig: - 98 02 7# chkconfig: - 98 02
8# 8#
9### BEGIN INIT INFO 9### BEGIN INIT INFO
10# Provides: cinder-group-active
10# Required-Start: $remote_fs $network $syslog 11# Required-Start: $remote_fs $network $syslog
11# Required-Stop: $remote_fs $syslog 12# Required-Stop: $remote_fs $syslog
12# Default-Start: 2 3 4 5 13# Default-Start: 2 3 4 5