Skip to content

Commit 5cf9b17

Browse files
committed
Pet rubocop
1 parent e34750a commit 5cf9b17

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/puppet/type/openldap_database.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ def insync?(is)
9494
when %r{^\{MD5\}.+}
9595
"{MD5}#{Digest::MD5.hexdigest(should)}" == is
9696
when %r{^\{SMD5\}.+}
97-
salt = is[16..-1]
97+
salt = is[16..]
9898
md5_hash_with_salt = "#{Digest::MD5.digest(should + salt)}#{salt}"
9999
is == "{SMD5}#{[md5_hash_with_salt].pack('m').delete("\n")}"
100100
when %r{^\{SSHA\}.+}
101101
decoded = Base64.decode64(is.gsub(%r{^\{SSHA\}}, ''))
102-
salt = decoded[20..-1]
102+
salt = decoded[20..]
103103
"{SSHA}#{Base64.encode64("#{Digest::SHA1.digest("#{should}#{salt}")}#{salt}").chomp}" == is
104104
when %r{^\{SHA\}.+}
105105
"{SHA}#{Digest::SHA1.hexdigest(should)}" == is
106106
when %r{^\{(SHA(256|384|512))\}}
107-
matches = is.match("^\{(SHA[\\d]{,3})\}")
107+
matches = is.match('^{(SHA[\\d]{,3})}')
108108
raise ArgumentError, "Invalid password format: #{is}" if matches.nil?
109109

110110
crypto = matches[1]

spec/functions/openldap_password_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# rubocop:disable RSpec/DescribeSymbol
66
describe :openldap_password do
7-
it { is_expected.not_to eq(nil) }
7+
it { is_expected.not_to be_nil }
88

99
it 'fails with wrong number of arguments' do
1010
is_expected.to run.with_params.and_raise_error(StandardError)

0 commit comments

Comments
 (0)