Cleanup minor rubocop offenses

Cleaned up all the minor rubocop issues, the ones left relate to
complex logic and what I think is a bug in rubocop for nested
vs compact modules/class definitions.

Change-Id: I75515d7b1faadb6de6377081fc7d5281a4c64c7d
This commit is contained in:
Mark Vanderwiel 2015-05-29 12:11:46 -05:00
parent ffe3f30c05
commit e5627ca58b
7 changed files with 39 additions and 69 deletions

View File

@ -1,38 +1,11 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2015-02-27 14:14:06 -0600 using RuboCop version 0.29.1.
# on 2015-05-29 12:11:07 -0500 using RuboCop version 0.29.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: 1
Metrics/AbcSize:
Max: 18
# Offense count: 3
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/ClassAndModuleChildren:
Enabled: false
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/EmptyLinesAroundBlockBody:
Enabled: false
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/FirstParameterIndentation:
Enabled: false
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Enabled: false
# Offense count: 34
# Cop supports --auto-correct.
Style/SingleSpaceBeforeFirstArg:
Enabled: false

View File

@ -1,22 +1,22 @@
# encoding: UTF-8
name 'openstack-orchestration'
maintainer 'openstack-chef'
name 'openstack-orchestration'
maintainer 'openstack-chef'
maintainer_email 'opscode-chef-openstack@googlegroups.com'
license 'Apache 2.0'
description 'Installs and configures the Heat Service'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '11.0.0'
recipe 'openstack-orchestration::api', 'Start and configure the Heat API service'
recipe 'openstack-orchestration::api-cfn', 'Start and configure the Heat API CloudFormation service'
recipe 'openstack-orchestration::api-cloudwatch', 'Start and configure the Heat API CloudWatch service'
recipe 'openstack-orchestration::client', 'Installs packages for heat client'
recipe 'openstack-orchestration::common', 'Installs packages and configures a Heat Server'
recipe 'openstack-orchestration::engine', 'Sets up Heat database and starts Heat Engine service'
recipe 'openstack-orchestration::identity_registration', 'Registers Heat service, user and endpoints with Keystone'
license 'Apache 2.0'
description 'Installs and configures the Heat Service'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '11.0.0'
recipe 'openstack-orchestration::api', 'Start and configure the Heat API service'
recipe 'openstack-orchestration::api-cfn', 'Start and configure the Heat API CloudFormation service'
recipe 'openstack-orchestration::api-cloudwatch', 'Start and configure the Heat API CloudWatch service'
recipe 'openstack-orchestration::client', 'Installs packages for heat client'
recipe 'openstack-orchestration::common', 'Installs packages and configures a Heat Server'
recipe 'openstack-orchestration::engine', 'Sets up Heat database and starts Heat Engine service'
recipe 'openstack-orchestration::identity_registration', 'Registers Heat service, user and endpoints with Keystone'
%w{ ubuntu fedora redhat centos }.each do |os|
%w(ubuntu fedora redhat centos).each do |os|
supports os
end
depends 'openstack-common', '>= 11.0.0'
depends 'openstack-identity', '>= 11.0.0'
depends 'openstack-common', '>= 11.0.0'
depends 'openstack-identity', '>= 11.0.0'

View File

@ -84,15 +84,15 @@ elsif mq_service_type == 'qpid'
end
directory '/etc/heat' do
group node['openstack']['orchestration']['group']
owner node['openstack']['orchestration']['user']
group node['openstack']['orchestration']['group']
owner node['openstack']['orchestration']['user']
mode 00700
action :create
end
directory '/etc/heat/environment.d' do
group node['openstack']['orchestration']['group']
owner node['openstack']['orchestration']['user']
group node['openstack']['orchestration']['group']
owner node['openstack']['orchestration']['user']
mode 00700
action :create
end
@ -105,9 +105,9 @@ end
template '/etc/heat/heat.conf' do
source 'heat.conf.erb'
group node['openstack']['orchestration']['group']
owner node['openstack']['orchestration']['user']
mode 00640
group node['openstack']['orchestration']['group']
owner node['openstack']['orchestration']['user']
mode 00640
variables(
stack_domain_admin_password: stack_domain_admin_password,
mq_service_type: mq_service_type,
@ -128,9 +128,9 @@ end
template '/etc/heat/environment.d/default.yaml' do
source 'default.yaml.erb'
group node['openstack']['orchestration']['group']
owner node['openstack']['orchestration']['user']
mode 00644
group node['openstack']['orchestration']['group']
owner node['openstack']['orchestration']['user']
mode 00644
end
execute 'heat-manage db_sync' do

View File

@ -3,7 +3,6 @@ require_relative 'spec_helper'
describe 'openstack-orchestration::client' do
describe 'redhat' do
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
let(:chef_run) { runner.converge(described_recipe) }

View File

@ -3,7 +3,6 @@ require_relative 'spec_helper'
describe 'openstack-orchestration::client' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:chef_run) { runner.converge(described_recipe) }

View File

@ -39,7 +39,6 @@ describe 'openstack-orchestration::common' do
node.set['openstack']['orchestration']['misc_heat'] = ['MISC_OPTION=FOO']
expect(chef_run).to render_file(file.name).with_content('MISC_OPTION=FOO')
end
end
end
end

View File

@ -98,26 +98,26 @@ end
shared_examples 'expects to create heat directories' do
it 'creates /etc/heat' do
expect(chef_run).to create_directory('/etc/heat').with(
owner: 'heat',
group: 'heat',
mode: 0700
)
owner: 'heat',
group: 'heat',
mode: 0700
)
end
it 'creates /etc/heat/environment.d' do
expect(chef_run).to create_directory('/etc/heat/environment.d').with(
owner: 'heat',
group: 'heat',
mode: 0700
)
owner: 'heat',
group: 'heat',
mode: 0700
)
end
it 'creates /var/cache/heat' do
expect(chef_run).to create_directory('/var/cache/heat').with(
owner: 'heat',
group: 'heat',
mode: 0700
)
owner: 'heat',
group: 'heat',
mode: 0700
)
end
end