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: Ie9fe1dd502ad09a9887045361bc1366cb116b5a4
This commit is contained in:
Mark Vanderwiel 2015-05-28 13:13:18 -05:00 committed by Ma Wen Cheng
parent 15d607a0cb
commit 8974221a00
4 changed files with 35 additions and 46 deletions

View File

@ -1,22 +1,11 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2015-03-02 13:36:04 -0600 using RuboCop version 0.28.0.
# 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: 5
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/ClassAndModuleChildren:
Enabled: false
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Enabled: false
# Offense count: 15
# Cop supports --auto-correct.
Style/SingleSpaceBeforeFirstArg:
Enabled: false
# This configuration was generated by `rubocop --auto-gen-config`
# on 2015-05-28 13:09:57 -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: 4
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/ClassAndModuleChildren:
Enabled: false

View File

@ -1,16 +1,16 @@
name 'openstack-bare-metal'
maintainer 'openstack-chef'
name 'openstack-bare-metal'
maintainer 'openstack-chef'
maintainer_email 'opscode-chef-openstack@googlegroups.com'
license 'Apache 2.0'
description 'Installs/Configures OpenStack Bare Metal service Ironic'
license 'Apache 2.0'
description 'Installs/Configures OpenStack Bare Metal service Ironic'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '11.0.0'
version '11.0.0'
recipe 'openstack-bare-metal::api', 'Installs the ironic-api, sets up the ironic database'
recipe 'openstack-bare-metal::conductor', 'Installs the ironic-conductor service'
recipe 'openstack-bare-metal::default', 'Temp workaround to create ironic db with user'
recipe 'openstack-bare-metal::identity_registration', 'Registers ironic service/user/endpoints in keystone'
recipe 'openstack-bare-metal::ironic-common', 'Defines the common pieces of repeated code from the other recipes'
recipe 'openstack-bare-metal::api', 'Installs the ironic-api, sets up the ironic database'
recipe 'openstack-bare-metal::conductor', 'Installs the ironic-conductor service'
recipe 'openstack-bare-metal::default', 'Temp workaround to create ironic db with user'
recipe 'openstack-bare-metal::identity_registration', 'Registers ironic service/user/endpoints in keystone'
recipe 'openstack-bare-metal::ironic-common', 'Defines the common pieces of repeated code from the other recipes'
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

@ -44,7 +44,7 @@ end
directory '/etc/ironic' do
owner node['openstack']['bare-metal']['user']
group node['openstack']['bare-metal']['group']
mode 00750
mode 00750
action :create
end
@ -98,7 +98,7 @@ end
template '/etc/ironic/rootwrap.conf' do
source 'rootwrap.conf.erb'
# Must be root!
owner 'root'
group 'root'
mode 00644
owner 'root'
group 'root'
mode 00644
end

View File

@ -102,9 +102,9 @@ describe 'openstack-bare-metal::ironic-common' do
it 'sets the default auth attributes' do
[
/^insecure=false$/,
%r(^signing_dir=/var/cache/ironic/api$),
%r(^auth_uri=http://127.0.0.1:5000/v2.0$),
%r(^identity_uri=http://127.0.0.1:35357/$),
%r{^signing_dir=/var/cache/ironic/api$},
%r{^auth_uri=http://127.0.0.1:5000/v2.0$},
%r{^identity_uri=http://127.0.0.1:35357/$},
/^auth_version=v2.0$/,
/^admin_user=ironic$/,
/^admin_password=service_pass$/,
@ -116,7 +116,7 @@ describe 'openstack-bare-metal::ironic-common' do
end
it 'has default neutron attributes' do
expect(chef_run).to render_config_file(file.name).with_section_content('neutron', %r(^url=http://127.0.0.1:9696$))
expect(chef_run).to render_config_file(file.name).with_section_content('neutron', %r{^url=http://127.0.0.1:9696$})
end
context 'tftp' do
@ -127,8 +127,8 @@ describe 'openstack-bare-metal::ironic-common' do
it 'sets tftp attributes' do
[
/^tftp_server=127.0.0.1$/,
%r(^tftp_root=/var/lib/tftpboot$),
%r(^tftp_master_path=/var/lib/tftpboot/master_images$)
%r{^tftp_root=/var/lib/tftpboot$},
%r{^tftp_master_path=/var/lib/tftpboot/master_images$}
].each do |line|
expect(chef_run).to render_config_file(file.name).with_section_content('pxe', line)
end
@ -269,8 +269,8 @@ describe 'openstack-bare-metal::ironic-common' do
it 'sets the default attributes' do
[
%r(^filters_path=/etc/ironic/rootwrap.d,/usr/share/ironic/rootwrap$),
%r(^exec_dirs=/sbin,/usr/sbin,/bin,/usr/bin$),
%r{^filters_path=/etc/ironic/rootwrap.d,/usr/share/ironic/rootwrap$},
%r{^exec_dirs=/sbin,/usr/sbin,/bin,/usr/bin$},
/^use_syslog=false$/,
/^syslog_log_facility=syslog$/,
/^syslog_log_level=ERROR$/