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: Ib326cac0e09df628189e290807513bad59df0b76
This commit is contained in:
parent
4924c2e131
commit
d2d9cd81ec
|
@ -1,50 +1,11 @@
|
|||
# This configuration was generated by `rubocop --auto-gen-config`
|
||||
# on 2015-02-27 14:10:04 -0600 using RuboCop version 0.29.1.
|
||||
# on 2015-05-29 12:18:25 -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: 2
|
||||
# Cop supports --auto-correct.
|
||||
Lint/DeprecatedClassMethods:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Lint/StringConversionInInterpolation:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 3
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||
Style/ClassAndModuleChildren:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||
Style/EmptyLinesAroundBlockBody:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 1
|
||||
# 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: 10
|
||||
# Cop supports --auto-correct.
|
||||
Style/SingleSpaceBeforeFirstArg:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 3
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||
Style/StringLiteralsInInterpolation:
|
||||
Enabled: false
|
||||
|
|
12
metadata.rb
12
metadata.rb
|
@ -1,10 +1,10 @@
|
|||
name 'openstack-telemetry'
|
||||
maintainer 'openstack-chef'
|
||||
name 'openstack-telemetry'
|
||||
maintainer 'openstack-chef'
|
||||
maintainer_email 'opscode-chef-openstack@googlegroups.com'
|
||||
license 'Apache 2.0'
|
||||
description 'The OpenStack Metering service Ceilometer.'
|
||||
license 'Apache 2.0'
|
||||
description 'The OpenStack Metering service Ceilometer.'
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version '11.0.0'
|
||||
version '11.0.0'
|
||||
|
||||
recipe 'openstack-telemetry::agent-central', 'Installs agent central service.'
|
||||
recipe 'openstack-telemetry::agent-compute', 'Installs agent compute service.'
|
||||
|
@ -17,7 +17,7 @@ recipe 'openstack-telemetry::alarm-notifier', 'Installs the alarm notifier servi
|
|||
recipe 'openstack-telemetry::common', 'Common metering configuration.'
|
||||
recipe 'openstack-telemetry::identity_registration', 'Registers the endpoints, tenant and user for metering service with Keystone'
|
||||
|
||||
%w{ ubuntu suse }.each do |os|
|
||||
%w(ubuntu suse).each do |os|
|
||||
supports os
|
||||
end
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ if node['platform'] == 'ubuntu'
|
|||
init_script = '/etc/init/ceilometer-agent-compute.conf'
|
||||
execute 'fix init script' do
|
||||
command "cp #{init_script}.dpkg-new #{init_script}"
|
||||
not_if { ::File.exists?(init_script) }
|
||||
not_if { ::File.exist?(init_script) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ include_recipe 'openstack-telemetry::common'
|
|||
directory ::File.dirname(node['openstack']['telemetry']['api']['auth']['cache_dir']) do
|
||||
owner node['openstack']['telemetry']['user']
|
||||
group node['openstack']['telemetry']['group']
|
||||
mode 00700
|
||||
mode 00700
|
||||
end
|
||||
|
||||
platform = node['openstack']['telemetry']['platform']
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
include_recipe 'openstack-telemetry::common'
|
||||
|
||||
conf_switch = "--config-file #{node["openstack"]["telemetry"]["conf"]}"
|
||||
conf_switch = "--config-file #{node['openstack']['telemetry']['conf']}"
|
||||
|
||||
execute 'database migration' do
|
||||
command "ceilometer-dbsync #{conf_switch}"
|
||||
|
@ -43,7 +43,7 @@ if node['platform'] == 'ubuntu'
|
|||
init_script = '/etc/init/ceilometer-collector.conf'
|
||||
execute 'fix init script' do
|
||||
command "cp #{init_script}.dpkg-new #{init_script}"
|
||||
not_if { ::File.exists?(init_script) }
|
||||
not_if { ::File.exist?(init_script) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -71,14 +71,14 @@ identity_uri = identity_uri_transform(identity_admin_endpoint)
|
|||
|
||||
Chef::Log.debug("openstack-telemetry::common:service_user|#{service_user}")
|
||||
Chef::Log.debug("openstack-telemetry::common:service_tenant|#{service_tenant}")
|
||||
Chef::Log.debug("openstack-telemetry::common:identity_endpoint|#{identity_endpoint.to_s}")
|
||||
Chef::Log.debug("openstack-telemetry::common:identity_endpoint|#{identity_endpoint}")
|
||||
|
||||
metering_secret = get_secret 'openstack_metering_secret'
|
||||
|
||||
directory node['openstack']['telemetry']['conf_dir'] do
|
||||
owner node['openstack']['telemetry']['user']
|
||||
group node['openstack']['telemetry']['group']
|
||||
mode 00750
|
||||
mode 00750
|
||||
|
||||
action :create
|
||||
end
|
||||
|
@ -89,9 +89,9 @@ end
|
|||
|
||||
template node['openstack']['telemetry']['conf'] do
|
||||
source 'ceilometer.conf.erb'
|
||||
owner node['openstack']['telemetry']['user']
|
||||
group node['openstack']['telemetry']['group']
|
||||
mode 00640
|
||||
owner node['openstack']['telemetry']['user']
|
||||
group node['openstack']['telemetry']['group']
|
||||
mode 00640
|
||||
|
||||
variables(
|
||||
auth_uri: auth_uri,
|
||||
|
|
|
@ -4,7 +4,6 @@ require_relative 'spec_helper'
|
|||
|
||||
describe 'openstack-telemetry::client' do
|
||||
describe 'ubuntu' do
|
||||
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
let(:chef_run) { runner.converge(described_recipe) }
|
||||
|
|
|
@ -58,13 +58,13 @@ describe 'openstack-telemetry::common' do
|
|||
|
||||
it 'has default values' do
|
||||
node.set['openstack']['telemetry']['syslog']['use'] = true
|
||||
[%r(^os_auth_url = http://127.0.0.1:5000/v2.0$),
|
||||
[%r{^os_auth_url = http://127.0.0.1:5000/v2.0$},
|
||||
/^os_tenant_name = service$/,
|
||||
/^os_password = ceilometer-pass$/,
|
||||
/^os_username = ceilometer$/,
|
||||
/^verbose = true$/,
|
||||
/^debug = false$/,
|
||||
%r(^log_config = /etc/openstack/logging.conf$),
|
||||
%r{^log_config = /etc/openstack/logging.conf$},
|
||||
/^glance_registry_host = 127.0.0.1$/,
|
||||
/^periodic_interval = 600$/].each do |line|
|
||||
expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line)
|
||||
|
@ -334,8 +334,7 @@ describe 'openstack-telemetry::common' do
|
|||
|
||||
it 'has bind_port set' do
|
||||
node.set['openstack']['endpoints']['telemetry-api-bind']['port'] = '9999'
|
||||
expect(chef_run).to render_file(file.name).with_content(
|
||||
/^port = 9999$/)
|
||||
expect(chef_run).to render_file(file.name).with_content(/^port = 9999$/)
|
||||
end
|
||||
|
||||
it 'has vmware section' do
|
||||
|
@ -357,7 +356,6 @@ describe 'openstack-telemetry::common' do
|
|||
.with_section_content('notification', /^store_events = false$/)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue