Skip to content

Commit 1de4526

Browse files
committed
Fix rubocop
1 parent 8b678e4 commit 1de4526

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

Diff for: spec/plans/add_replica_spec.rb

+14-10
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@ def allow_standard_non_returning_calls
1111

1212
describe 'basic functionality' do
1313
let(:params) { { 'primary_host' => 'primary', 'replica_host' => 'replica' } }
14-
let(:certdata) { {
15-
'certificate-exists' => true,
16-
'certname' => 'primary',
17-
'extensions' => { '1.3.6.1.4.1.34380.1.1.9813' => 'A' },
18-
'dns-alt-names' => []
19-
} }
20-
let(:certstatus) { {
21-
'certificate-status' => 'valid',
22-
'reason' => 'Expires - 2099-01-01 00:00:00 UTC'
23-
} }
2414
let(:cfg) { { 'params' => { 'primary_host' => 'primary' } } }
15+
let(:certdata) do
16+
{
17+
'certificate-exists' => true,
18+
'certname' => 'primary',
19+
'extensions' => { '1.3.6.1.4.1.34380.1.1.9813' => 'A' },
20+
'dns-alt-names' => []
21+
}
22+
end
23+
let(:certstatus) do
24+
{
25+
'certificate-status' => 'valid',
26+
'reason' => 'Expires - 2099-01-01 00:00:00 UTC'
27+
}
28+
end
2529

2630
it 'runs successfully when the primary does not have alt-names' do
2731
allow_standard_non_returning_calls

Diff for: tasks/cert_valid_status.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require 'puppet'
55
require 'json'
66

7-
$params = JSON.parse(STDIN.read)
7+
params = JSON.parse(STDIN.read)
88

99
Puppet.initialize_settings
1010

@@ -14,7 +14,7 @@
1414
cert_provider = Puppet::X509::CertProvider.new
1515
ssl_provider = Puppet::SSL::SSLProvider.new
1616
password = cert_provider.load_private_key_password
17-
ssl_context = ssl_provider.load_context(certname: $params['certname'], password: password)
17+
ssl_context = ssl_provider.load_context(certname: params['certname'], password: password)
1818
rescue Puppet::SSL::CertVerifyError => e
1919
status = { 'certificate-status' => 'invalid', 'reason' => e.message }
2020
rescue Puppet::Error => e
@@ -27,4 +27,4 @@
2727
result = status
2828

2929
# Put the result to stdout
30-
puts result.to_json
30+
puts result.to_json

0 commit comments

Comments
 (0)