Skip to content

Commit

Permalink
Fix the postgresql::postgresql_password() function
Browse files Browse the repository at this point in the history
The changes in #1512 introduced a regression when a hash value is not
explicitly passed:

```
Puppet Server Error: Evaluation Error: Error while evaluating a Function Call, failed to coerce org.jruby.RubySymbol to java.lang.String
```

Fixes #1528
  • Loading branch information
smortex committed Oct 11, 2023
1 parent ba8e6d3 commit 608d8d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet/functions/postgresql/postgresql_password.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
end

def default_impl(username, password, sensitive = false, hash = nil, salt = nil)
hash = call_function(:'postgresql::default', 'password_encryption') if hash.nil?
hash = call_function('postgresql::default', 'password_encryption') if hash.nil?
password = password.unwrap if password.respond_to?(:unwrap)
if password.is_a?(String) && password.match?(%r{^(md5[0-9a-f]{32}$|SCRAM-SHA-256\$)})
return Puppet::Pops::Types::PSensitiveType::Sensitive.new(password) if sensitive
Expand Down

0 comments on commit 608d8d7

Please sign in to comment.