Skip to content

Commit

Permalink
Merge 889035f into 08806c3
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jan 4, 2020
2 parents 08806c3 + 889035f commit 7c88ac4
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '2.9.0'
modulesync_config_version: '2.10.1'
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require: rubocop-rspec
AllCops:
TargetRubyVersion: 1.9
TargetRubyVersion: 2.1
Include:
- ./**/*.rb
Exclude:
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ dist: bionic
language: ruby
cache: bundler
before_install:
- gem update --system
- gem update bundler
- yes | gem update --system
- bundle --version
script:
- 'bundle exec rake $CHECK'
Expand Down Expand Up @@ -69,6 +68,7 @@ branches:
- /^v\d/
notifications:
email: false
webhooks: https://voxpupu.li/incoming/travis
irc:
on_success: always
on_failure: always
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ group :test do
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
gem 'puppet-lint-absolute_classname-check', '>= 2.0.0', :require => false
gem 'puppet-lint-topscope-variable-check', :require => false
gem 'puppet-lint-legacy_facts-check', :require => false
gem 'puppet-lint-anchor-check', :require => false
Expand Down
10 changes: 0 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ rescue LoadError
end

PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
PuppetLint.configuration.absolute_classname_reverse = true

exclude_paths = %w(
pkg/**/*
vendor/**/*
.vendor/**/*
spec/**/*
)
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths

desc 'Auto-correct puppet-lint offenses'
task 'lint:auto_correct' do
Expand Down
100 changes: 50 additions & 50 deletions lib/puppet/type/splunk_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@
end

## Generate purge parameters for the splunk_config type
[
:purge_inputs,
:purge_outputs,
:purge_alert_actions,
:purge_authentication,
:purge_authorize,
:purge_deploymentclient,
:purge_distsearch,
:purge_indexes,
:purge_limits,
:purge_metadata,
:purge_props,
:purge_server,
:purge_serverclass,
:purge_transforms,
:purge_web,
:purge_uiprefs,
:purge_forwarder_deploymentclient,
:purge_forwarder_inputs,
:purge_forwarder_outputs,
:purge_forwarder_props,
:purge_forwarder_transforms,
:purge_forwarder_web,
:purge_forwarder_server
%i[
purge_inputs
purge_outputs
purge_alert_actions
purge_authentication
purge_authorize
purge_deploymentclient
purge_distsearch
purge_indexes
purge_limits
purge_metadata
purge_props
purge_server
purge_serverclass
purge_transforms
purge_web
purge_uiprefs
purge_forwarder_deploymentclient
purge_forwarder_inputs
purge_forwarder_outputs
purge_forwarder_props
purge_forwarder_transforms
purge_forwarder_web
purge_forwarder_server
].each do |p|
newparam(p) do
newvalues(:true, :false)
Expand Down Expand Up @@ -91,36 +91,36 @@ def generate
end

def set_provider_paths
[
:splunk_alert_actions,
:splunk_authentication,
:splunk_authorize,
:splunk_deploymentclient,
:splunk_distsearch,
:splunk_indexes,
:splunk_limits,
:splunk_input,
:splunk_output,
:splunk_metadata,
:splunk_props,
:splunk_server,
:splunk_serverclass,
:splunk_transforms,
:splunk_web,
:splunk_uiprefs
%i[
splunk_alert_actions
splunk_authentication
splunk_authorize
splunk_deploymentclient
splunk_distsearch
splunk_indexes
splunk_limits
splunk_input
splunk_output
splunk_metadata
splunk_props
splunk_server
splunk_serverclass
splunk_transforms
splunk_web
splunk_uiprefs
].each do |res_type|
provider_class = Puppet::Type.type(res_type).provider(:ini_setting)
provider_class.file_path = self[:server_confdir]
end
[
:splunkforwarder_deploymentclient,
:splunkforwarder_input,
:splunkforwarder_output,
:splunkforwarder_props,
:splunkforwarder_transforms,
:splunkforwarder_web,
:splunkforwarder_server,
:splunkforwarder_limits
%i[
splunkforwarder_deploymentclient
splunkforwarder_input
splunkforwarder_output
splunkforwarder_props
splunkforwarder_transforms
splunkforwarder_web
splunkforwarder_server
splunkforwarder_limits
].each do |res_type|
provider_class = Puppet::Type.type(res_type).provider(:ini_setting)
provider_class.file_path = self[:forwarder_confdir]
Expand Down
6 changes: 5 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@
# Otherwise we need to match the correct facter version to the used puppet version.
# as of 2019-10-31, puppet 5 ships facter 3.11 and puppet 6 ships facter 3.14
# https://puppet.com/docs/puppet/5.5/about_agent.html
#
# The environment variable `PUPPET_VERSION` is available in our travis environment, but we cannot rely on it
# if somebody runs the tests locally. For that case we should fallback the the puppet gem version.
c.default_facter_version = if ENV['FACTERDB_FACTS_VERSION']
ENV['FACTERDB_FACTS_VERSION']
else
Gem::Dependency.new('', ENV['PUPPET_VERSION']).match?('', '5') ? '3.11.0' : '3.14.0'
puppet_version = ENV['PUPPET_VERSION'] ? ENV['PUPPET_VERSION'] : Gem.loaded_specs['puppet'].version.to_s
Gem::Dependency.new('', puppet_version).match?('', '5') ? '3.11.0' : '3.14.0'
end

# Coverage generation
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/puppet/type/splunk_types_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SPLUNK_TYPES.each do |type, file_name|
describe Puppet::Type.type(type) do
context 'attributes' do
[:name, :setting, :section, :context].each do |parameter|
%i[name setting section context].each do |parameter|
describe parameter.to_s do
it 'has a name attribute' do
expect(described_class.attrclass(parameter)).not_to be_nil
Expand All @@ -26,7 +26,7 @@
end

it 'has name, context, setting and section as namevars' do
expect(described_class.key_attributes.sort).to eq([:context, :name, :section, :setting])
expect(described_class.key_attributes.sort).to eq(%i[context name section setting])
end
end

Expand Down

0 comments on commit 7c88ac4

Please sign in to comment.