From 608d8d79e9cff72239fc31301b233b418f324eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 11 Oct 2023 08:21:22 -1000 Subject: [PATCH] Fix the postgresql::postgresql_password() function 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 --- lib/puppet/functions/postgresql/postgresql_password.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/functions/postgresql/postgresql_password.rb b/lib/puppet/functions/postgresql/postgresql_password.rb index ef899254da..a444d5cd01 100644 --- a/lib/puppet/functions/postgresql/postgresql_password.rb +++ b/lib/puppet/functions/postgresql/postgresql_password.rb @@ -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