Skip to content

Commit 97c82eb

Browse files
committed
Lint fixes
Doing what the linter and Rubocop told me to
1 parent f9420ab commit 97c82eb

File tree

6 files changed

+21
-26
lines changed

6 files changed

+21
-26
lines changed

Diff for: spec/acceptance/peadm_spec.rb

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
require 'spec_helper_acceptance'
22
# @summary: default test does nothing
3-
def test_peadm()
4-
5-
#return unless os[:family] != 'windows'
6-
return unless os[:family] != 'Darwin'
3+
def test_peadm
4+
# return unless os[:family] != 'windows'
5+
return unless os[:family] != 'Darwin'
76
end
87

98
describe 'default' do
109
context 'example acceptance do nothing' do
1110
it do
12-
test_peadm()
11+
test_peadm
1312
end
1413
end
15-
end
14+
end

Diff for: spec/spec_helper_acceptance.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
require 'puppet_litmus'
44
require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb'))
55

6-
PuppetLitmus.configure!
6+
PuppetLitmus.configure!

Diff for: spec/spec_helper_acceptance_local.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ class Helper
88

99
def some_helper_method
1010
Helper.instance.bolt_run_script('path/to/file')
11-
end
11+
end

Diff for: tasks/sign_csr.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/opt/puppetlabs/puppet/bin/ruby
22
#
3-
# rubocop:disable Style/GlobalVars
43
require 'json'
54
require 'open3'
65

Diff for: tasks/submit_csr.rb

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
#!/opt/puppetlabs/puppet/bin/ruby
22
#
3-
# rubocop:disable Style/GlobalVars
43
require 'json'
54
require 'open3'
65

76
def main
8-
params = JSON.parse(STDIN.read)
9-
majver = %x{/opt/puppetlabs/bin/puppet --version}
10-
.chomp
11-
.split('.')
12-
.first
13-
.to_i
7+
majver = `/opt/puppetlabs/bin/puppet --version`
8+
.chomp
9+
.split('.')
10+
.first
11+
.to_i
1412

1513
if majver < 6
16-
conf = %x{/opt/puppetlabs/bin/puppet config print dns_alt_names certname}
17-
.chomp
18-
.split("\n")
19-
.map {|line| line.split(' = ', 2) }
20-
.to_h
14+
conf = `/opt/puppetlabs/bin/puppet config print dns_alt_names certname`
15+
.chomp
16+
.split("\n")
17+
.map { |line| line.split(' = ', 2) }
18+
.to_h
2119

2220
cmd = ['/opt/puppetlabs/bin/puppet', 'certificate', 'generate',
2321
'--ca-location', 'remote',
2422
'--dns-alt-names', conf['dns_alt_names'],
25-
conf['certname']
26-
]
23+
conf['certname']]
2724
else
2825
cmd = ['/opt/puppetlabs/bin/puppet', 'ssl', 'submit_request']
2926
end

Diff for: tasks/trusted_facts.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
ssldir = Puppet.settings[:ssldir]
1010
certname = Puppet.settings[:certname]
1111

12-
oids = Puppet::SSL::Oids::PUPPET_OIDS.reduce({}) do |memo,oid|
12+
oids = Puppet::SSL::Oids::PUPPET_OIDS.reduce({}) do |memo, oid|
1313
memo.merge(oid[0] => oid[1])
1414
end
1515

1616
raw = File.read("#{ssldir}/certs/#{certname}.pem")
1717

1818
cert = OpenSSL::X509::Certificate.new(raw)
1919

20-
extensions = cert.extensions.reduce({}) do |memo,ext|
20+
extensions = cert.extensions.reduce({}) do |memo, ext|
2121
case oids[ext.oid]
2222
when nil
2323
memo.merge(ext.oid => ext.value[2..-1])
@@ -27,6 +27,6 @@
2727
end
2828
end
2929

30-
result = {'extensions' => extensions}
30+
result = { 'extensions' => extensions }
3131

3232
puts result.to_json

0 commit comments

Comments
 (0)