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
This commit is contained in:
Samuel Cassiba 2017-08-20 10:11:45 -04:00
parent a29984d301
commit 60a38b538d
10 changed files with 23 additions and 46 deletions

View File

@ -1,5 +1,3 @@
inherit_from: .rubocop_todo.yml
AllCops:
Include:
- metadata.rb

View File

@ -1,22 +0,0 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-08-17 14:15:59 +0200 using RuboCop version 0.47.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 18
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 178
# Offense count: 4
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'recipes/api.rb'
- 'recipes/cinder-common.rb'
- 'recipes/identity_registration.rb'
- 'recipes/volume.rb'

View File

@ -1,20 +1,20 @@
task default: ["test"]
task :test => [:lint, :style, :unit]
task :test => [:syntax, :lint, :unit]
desc "Vendor the cookbooks in the Berksfile"
task :berks_prep do
sh %{chef exec berks vendor}
end
desc "Run FoodCritic (lint) tests"
task :lint do
sh %{chef exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .}
desc "Run FoodCritic (syntax) tests"
task :syntax do
sh %{chef exec foodcritic --exclude spec -f any .}
end
desc "Run RuboCop (style) tests"
task :style do
sh %{chef exec rubocop}
desc "Run RuboCop (lint) tests"
task :lint do
sh %{chef exec cookstyle}
end
desc "Run RSpec (unit) tests"

View File

@ -30,8 +30,8 @@ default['developer_mode'] = false # we want secure passwords by default
# Set to some text value if you want templated config files
# to contain a custom banner at the top of the written file
default['openstack']['block-storage']['custom_template_banner'] = '
# This file autogenerated by Chef
# Do not edit, changes will be overwritten
# This file is automatically generated by Chef
# Any changes will be overwritten
'
# Specify policy.json remote file to import
@ -79,7 +79,7 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
'cinder_common_packages' => ['openstack-cinder'],
'cinder_api_packages' => ['openstack-cinder'],
'cinder_api_service' => 'openstack-cinder-api',
'cinder_volume_packages' => ['qemu-img'],
'cinder_volume_packages' => ['qemu-img-ev'],
'cinder_volume_service' => 'openstack-cinder-volume',
'cinder_scheduler_packages' => [],
'cinder_scheduler_service' => 'openstack-cinder-scheduler',
@ -93,7 +93,7 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
'cinder_svc_packages' => ['sysfsutils'],
'cinder_lvm_packages' => ['lvm2'],
'cinder_flashsystem_packages' => ['sysfsutils'],
'package_overrides' => ''
'package_overrides' => '',
}
when 'debian'
# operating system user and group names
@ -115,7 +115,7 @@ when 'debian'
'cinder_svc_packages' => ['sysfsutils'],
'cinder_lvm_packages' => ['lvm2'],
'cinder_flashsystem_packages' => ['sysfsutils'],
'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'",
}
end

View File

@ -32,7 +32,7 @@ auth_url = ::URI.decode identity_admin_endpoint.to_s
interfaces = {
public: { url: public_endpoint('block-storage') },
internal: { url: internal_endpoint('block-storage') },
admin: { url: admin_endpoint('block-storage') }
admin: { url: admin_endpoint('block-storage') },
}
service_pass = get_password 'service', 'openstack-block-storage'
region = node['openstack']['block-storage']['region']
@ -52,7 +52,7 @@ connection_params = {
openstack_username: admin_user,
openstack_api_key: admin_pass,
openstack_project_name: admin_project,
openstack_domain_name: admin_domain
openstack_domain_name: admin_domain,
}
# Register VolumeV2 Service

View File

@ -208,7 +208,7 @@ describe 'openstack-block-storage::cinder-common' do
%r{^exec_dirs = /sbin,/usr/sbin,/bin,/usr/bin$},
/^use_syslog = false$/,
/^syslog_log_facility = syslog$/,
/^syslog_log_level = ERROR$/
/^syslog_log_level = ERROR$/,
].each do |line|
expect(chef_run).to render_file(file.name).with_content(line)
end

View File

@ -17,7 +17,7 @@ describe 'openstack-block-storage::identity_registration' do
openstack_username: 'admin',
openstack_api_key: 'emc_test_pass',
openstack_project_name: 'admin',
openstack_domain_name: 'default'
openstack_domain_name: 'default',
}
service_name = 'cinderv2'
service_type = 'volumev2'

View File

@ -13,12 +13,12 @@ LOG_LEVEL = :fatal
REDHAT_OPTS = {
platform: 'redhat',
version: '7.1',
log_level: LOG_LEVEL
log_level: LOG_LEVEL,
}.freeze
UBUNTU_OPTS = {
platform: 'ubuntu',
version: '16.04',
log_level: LOG_LEVEL
log_level: LOG_LEVEL,
}.freeze
shared_context 'block-storage-stubs' do
@ -116,7 +116,7 @@ shared_examples 'creates_cinder_conf' do |service, user, group, action = :restar
/^project_domain_name = Default/,
%r{^auth_uri = http://127.0.0.1:5000/v3$},
%r{^auth_url = http://127.0.0.1:35357/v3$},
/^password = cinder-pass$/
/^password = cinder-pass$/,
].each do |line|
expect(chef_run).to render_config_file(file.name)
.with_section_content('keystone_authtoken', line)
@ -125,7 +125,7 @@ shared_examples 'creates_cinder_conf' do |service, user, group, action = :restar
it 'has oslo_messaging_notifications conf values' do
[
/^driver = cinder.openstack.common.notifier.rpc_notifier$/
/^driver = cinder.openstack.common.notifier.rpc_notifier$/,
].each do |line|
expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_notifications', line)
end

View File

@ -23,8 +23,8 @@ describe 'openstack-block-storage::volume' do
expect(chef_run).not_to upgrade_package('MySQL-python')
end
it 'upgrades qemu img package' do
expect(chef_run).to upgrade_package('qemu-img')
it 'upgrades qemu-img-ev package' do
expect(chef_run).to upgrade_package('qemu-img-ev')
end
it 'upgrades cinder iscsi package' do

View File

@ -7,6 +7,7 @@
# chkconfig: - 98 02
#
### BEGIN INIT INFO
# Provides: cinder-group-active
# Required-Start: $remote_fs $network $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5