Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ed6907c

Browse files
authoredSep 26, 2016
Merge pull request #1 from bastelfreak/rubocop
Rubocop
2 parents da5d112 + 3037bd7 commit ed6907c

40 files changed

+100
-112
lines changed
 
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
Puppet::Type.type(:ini_setting).provide(
22
:splunk,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
3+
parent: Puppet::Type.type(:ini_setting).provider(:ruby)
44
) do
55

6-
confine :true => false # Never automatically select this provider
6+
confine true: false # Never automatically select this provider
77

88
@file_path = nil
99

1010
def self.file_path
11-
raise Puppet::Error, "file_path must be set with splunk_config type before provider can be used" if @file_path.nil?
12-
raise Puppet::Error, "Child provider class does not support a file_name method" unless self.respond_to?(:file_name)
11+
raise Puppet::Error, 'file_path must be set with splunk_config type before provider can be used' if @file_path.nil?
12+
raise Puppet::Error, 'Child provider class does not support a file_name method' unless self.respond_to?(:file_name)
1313
File.join(@file_path, file_name)
1414
end
1515

1616
def self.set_file_path(path)
17-
@file_path=path
17+
@file_path = path
1818
end
1919
end

‎lib/puppet/provider/splunk_authentication/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_authentication).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/authentication.conf'

‎lib/puppet/provider/splunk_authorize/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_authorize).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/authorize.conf'

‎lib/puppet/provider/splunk_distsearch/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_distsearch).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/distsearch.conf'

‎lib/puppet/provider/splunk_indexes/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_indexes).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/indexes.conf'

‎lib/puppet/provider/splunk_input/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_input).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/inputs.conf'

‎lib/puppet/provider/splunk_limits/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_limits).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/limits.conf'

‎lib/puppet/provider/splunk_output/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_output).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/outputs.conf'

‎lib/puppet/provider/splunk_props/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_props).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/props.conf'

‎lib/puppet/provider/splunk_server/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_server).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/server.conf'

‎lib/puppet/provider/splunk_transforms/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_transforms).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/transforms.conf'

‎lib/puppet/provider/splunk_web/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunk_web).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/web.conf'

‎lib/puppet/provider/splunkforwarder_input/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunkforwarder_input).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/inputs.conf'
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
Puppet::Type.type(:splunkforwarder_output).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
6-
"system/local/outputs.conf"
6+
'system/local/outputs.conf'
77
end
88
end
9-

‎lib/puppet/provider/splunkforwarder_props/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunkforwarder_props).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/props.conf'

‎lib/puppet/provider/splunkforwarder_transforms/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunkforwarder_transforms).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/transforms.conf'

‎lib/puppet/provider/splunkforwarder_web/ini_setting.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Puppet::Type.type(:splunkforwarder_web).provide(
22
:ini_setting,
3-
:parent => Puppet::Type.type(:ini_setting).provider(:splunk)
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
44
) do
55
def self.file_name
66
'system/local/web.conf'
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_authentication) do
4-
@doc = "Manage splunk authentication settings in authentication.conf"
4+
@doc = 'Manage splunk authentication settings in authentication.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end
7-

‎lib/puppet/type/splunk_authorize.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_authorize) do
4-
@doc = "Manage splunk authorize settings in authorize.conf"
4+
@doc = 'Manage splunk authorize settings in authorize.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end

‎lib/puppet/type/splunk_config.rb

+34-36
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Require all of our types so the class names are resolvable for purging
2-
Dir[File.dirname(__FILE__) + '/*.rb'].each do |file|
3-
unless file == __FILE__
4-
require file
5-
end
2+
Dir[File.dirname(__FILE__) + '/*.rb'].each do |file|
3+
unless file == __FILE__
4+
require file
5+
end
66
end
77

88
Puppet::Type.newtype(:splunk_config) do
9-
newparam(:name, :namevar => true) do
9+
newparam(:name, namevar: true) do
1010
desc 'splunk config'
1111
end
1212

@@ -23,26 +23,26 @@
2323
end
2424

2525
## Generate purge parameters for the splunk_config type
26-
[
27-
:purge_inputs,
28-
:purge_outputs,
29-
:purge_authentication,
30-
:purge_authorize,
31-
:purge_distsearch,
32-
:purge_indexes,
33-
:purge_limits,
34-
:purge_props,
35-
:purge_server,
36-
:purge_transforms,
37-
:purge_web,
38-
:purge_forwarder_inputs,
39-
:purge_forwarder_outputs,
40-
:purge_forwarder_props,
41-
:purge_forwarder_transforms,
42-
:purge_forwarder_web
26+
[
27+
:purge_inputs,
28+
:purge_outputs,
29+
:purge_authentication,
30+
:purge_authorize,
31+
:purge_distsearch,
32+
:purge_indexes,
33+
:purge_limits,
34+
:purge_props,
35+
:purge_server,
36+
:purge_transforms,
37+
:purge_web,
38+
:purge_forwarder_inputs,
39+
:purge_forwarder_outputs,
40+
:purge_forwarder_props,
41+
:purge_forwarder_transforms,
42+
:purge_forwarder_web
4343
].each do |p|
4444
newparam(p) do
45-
newvalues(:true,:false)
45+
newvalues(:true, :false)
4646
defaultto :false
4747
end
4848
end
@@ -53,7 +53,7 @@
5353
def generate
5454
set_provider_paths
5555

56-
resources = Array.new
56+
resources = []
5757

5858
{
5959
Puppet::Type::Splunk_output => self[:purge_outputs],
@@ -71,14 +71,13 @@ def generate
7171
Puppet::Type::Splunkforwarder_props => self[:purge_forwarder_props],
7272
Puppet::Type::Splunkforwarder_transforms => self[:purge_forwarder_transforms],
7373
Puppet::Type::Splunkforwarder_web => self[:purge_forwarder_web]
74-
}.each do |k,purge|
74+
}.each do |k, purge|
7575
resources.concat(purge_splunk_resources(k)) if purge == :true
7676
end
7777

7878
return resources
7979
end
8080

81-
8281
def set_provider_paths
8382
[
8483
:splunk_authentication,
@@ -104,37 +103,36 @@ def set_provider_paths
104103
Puppet::Type.type(res_type).provider(:ini_setting).set_file_path(self[:forwarder_confdir])
105104
end
106105
end
107-
106+
108107
def purge_splunk_resources(klass)
109108
type_name = klass.name
110-
purge_resources = Array.new
111-
puppet_resources = Array.new
109+
purge_resources = []
110+
puppet_resources = []
112111

113112
# Search the catalog for resource types matching the provided class
114113
# type and build an array of puppet resources matching the namevar
115114
# as section/setting
116115
#
117116
catalog_resources = catalog.resources.select { |r| r.is_a?(klass) }
118117
catalog_resources.each do |res|
119-
puppet_resources << res[:section] + "/" + res[:setting]
118+
puppet_resources << res[:section] + '/' + res[:setting]
120119
end
121120

122-
123121
# Search the configured instances of the class type and purge them if
124122
# the instance name (setion/setting) isn't found in puppet_resources
125123
#
126124
Puppet::Type.type(type_name).instances.each do |instance|
127125
unless puppet_resources.include?(instance.name)
128126
purge_resources << Puppet::Type.type(type_name).new(
129-
:name => instance.name,
130-
:section => instance[:section],
131-
:setting => instance[:setting],
132-
:ensure => :absent
127+
name: instance.name,
128+
section: instance[:section],
129+
setting: instance[:setting],
130+
ensure: :absent
133131
)
134132
end
135133
end
136134

137135
return purge_resources
138136
end
139-
137+
140138
end

‎lib/puppet/type/splunk_distsearch.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_distsearch) do
4-
@doc= "Manage distsearch entries in distsearch.conf"
4+
@doc = 'Manage distsearch entries in distsearch.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end
7-

‎lib/puppet/type/splunk_indexes.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_indexes) do
4-
@doc = "Manage splunk index settings in indexes.conf"
4+
@doc = 'Manage splunk index settings in indexes.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end
7-

‎lib/puppet/type/splunk_input.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_input) do
4-
@doc = "Manage splunk input settings in inputs.conf"
4+
@doc = 'Manage splunk input settings in inputs.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end

‎lib/puppet/type/splunk_limits.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_limits) do
4-
@doc = "Manage splunk limits settings in limits.conf"
4+
@doc = 'Manage splunk limits settings in limits.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end

‎lib/puppet/type/splunk_output.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_output) do
4-
@doc = "Manage splunk output settings in outputs.conf"
4+
@doc = 'Manage splunk output settings in outputs.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end

‎lib/puppet/type/splunk_props.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_props) do
4-
@doc = "Manage splunk prop settings in props.conf"
4+
@doc = 'Manage splunk prop settings in props.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end

‎lib/puppet/type/splunk_server.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_server) do
4-
@doc = "Manage splunk server settings in server.conf"
4+
@doc = 'Manage splunk server settings in server.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end

‎lib/puppet/type/splunk_transforms.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_transforms) do
4-
@doc = "Manage splunk transforms settings in transforms.conf"
4+
@doc = 'Manage splunk transforms settings in transforms.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end

‎lib/puppet/type/splunk_web.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunk_web) do
4-
@doc = "Manage splunk web settings in web.conf"
4+
@doc = 'Manage splunk web settings in web.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunkforwarder_input) do
4-
@doc = "Manage splunkforwarder input settings in inputs.conf"
4+
@doc = 'Manage splunkforwarder input settings in inputs.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

3-
43
Puppet::Type.newtype(:splunkforwarder_output) do
5-
@doc = "Manage splunkforwarder output settings in outputs.conf"
4+
@doc = 'Manage splunkforwarder output settings in outputs.conf'
65
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
76
end
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunkforwarder_props) do
4-
@doc = "Manage splunkforwarder props settings in props.conf"
4+
@doc = 'Manage splunkforwarder props settings in props.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunkforwarder_transforms) do
4-
@doc = "Manage splunkforwarder transforms settings in transforms.conf"
4+
@doc = 'Manage splunkforwarder transforms settings in transforms.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
22

33
Puppet::Type.newtype(:splunkforwarder_web) do
4-
@doc = "Manage splunkforwarder web settings in web.conf"
4+
@doc = 'Manage splunkforwarder web settings in web.conf'
55
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
66
end
7-

‎lib/puppet_x/puppetlabs/splunk/type.rb

+16-17
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@ module PuppetX
22
module Puppetlabs
33
module Splunk
44
module Type
5-
65
def self.clone_type(type)
76
type.ensurable
87

98
type.define_singleton_method(:title_patterns) do
109
[
11-
[ /^([^\/]*)$/, [ [ :section ] ] ],
12-
[ /^(.*\/\/.*)$/, [ [ :section ] ] ],
13-
[ /^(.*)\/(.*)$/,
14-
[
15-
[:section, lambda{|x| x} ],
16-
[:setting, lambda{|x| x} ]
17-
]
10+
[/^([^\/]*)$/, [[:section]]],
11+
[/^(.*\/\/.*)$/, [[:section]]],
12+
[/^(.*)\/(.*)$/,
13+
[
14+
[:section, ->(x) { x }],
15+
[:setting, ->(x) { x }]
16+
]
1817
]
1918
]
2019
end
@@ -25,20 +24,20 @@ def self.clone_type(type)
2524
end
2625
end
2726
type.newparam(:setting) do
28-
desc 'The setting being defined.'
29-
isnamevar
30-
munge do |v|
31-
v.to_s.strip
32-
end
33-
end
34-
type.newparam(:section) do
35-
desc 'The section the setting is defined under.'
27+
desc 'The setting being defined.'
3628
isnamevar
3729
munge do |v|
3830
v.to_s.strip
3931
end
4032
end
41-
type.newparam(:name)
33+
type.newparam(:section) do
34+
desc 'The section the setting is defined under.'
35+
isnamevar
36+
munge do |v|
37+
v.to_s.strip
38+
end
39+
end
40+
type.newparam(:name)
4241
end
4342
end
4443
end

‎spec/acceptance/splunk_forwarder_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
describe 'splunk::forwarder class' do
44
context 'default parameters' do
55
# Using puppet_apply as a helper
6-
it 'should work idempotently with no errors' do
6+
it 'works idempotently with no errors' do
77
pp = <<-EOS
88
class { '::splunk::forwarder': }
99
EOS
1010

1111
# Run it twice and test for idempotency
12-
apply_manifest(pp, :catch_failures => true)
13-
apply_manifest(pp, :catch_changes => true)
12+
apply_manifest(pp, catch_failures: true)
13+
apply_manifest(pp, catch_changes: true)
1414
end
1515

1616
describe package('splunkforwarder') do

‎spec/acceptance/splunk_spec.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
describe 'splunk class' do
44
context 'default parameters' do
55
# Using puppet_apply as a helper
6-
it 'should work idempotently with no errors' do
6+
it 'works idempotently with no errors' do
77
pp = <<-EOS
88
class { '::splunk': }
99
EOS
1010

1111
# Run it twice and test for idempotency
12-
apply_manifest(pp, :catch_failures => true)
13-
apply_manifest(pp, :catch_changes => true)
12+
apply_manifest(pp, catch_failures: true)
13+
apply_manifest(pp, catch_changes: true)
1414
end
1515

1616
describe package('splunk') do
@@ -23,4 +23,3 @@ class { '::splunk': }
2323
end
2424
end
2525
end
26-

‎spec/spec_helper_acceptance.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
c.before :suite do
1616
# Install module and dependencies
1717
# Need to stage the Splunk/Splunkforwarder packages here.
18-
puppet_module_install(:source => proj_root, :module_name => 'splunk')
18+
puppet_module_install(source: proj_root, module_name: 'splunk')
1919
hosts.each do |host|
20-
on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
21-
on host, puppet('module', 'install', 'nanliu-staging'), { :acceptable_exit_codes => [0,1] }
22-
on host, puppet('module', 'install', 'puppetlabs-inifile'), { :acceptable_exit_codes => [0,1] }
20+
on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
21+
on host, puppet('module', 'install', 'nanliu-staging'), acceptable_exit_codes: [0, 1]
22+
on host, puppet('module', 'install', 'puppetlabs-inifile'), acceptable_exit_codes: [0, 1]
2323
end
2424
end
2525
end

‎spec/spec_helper_system.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
puppet_install
1919

2020
# Install modules and dependencies
21-
puppet_module_install(:source => proj_root, :module_name => 'splunk')
21+
puppet_module_install(source: proj_root, module_name: 'splunk')
2222
shell('puppet module install nanliu-staging --version 0.3.1')
2323
shell('puppet module install puppetlabs-stdlib --version 3.0.0')
2424
shell('puppet module install puppetlabs-inifile --version 1.0.0')
2525
end
2626
end
27-

‎spec/system/forwarder_spec.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
require 'pry'
33

44
describe 'setting up the forwarder' do
5-
6-
it 'should be able to set up a forwarder' do
5+
it 'is able to set up a forwarder' do
76
pp = <<-EOS
87
class { 'splunk::params':
98
version => '6.0',

0 commit comments

Comments
 (0)
Please sign in to comment.