Skip to content

Commit a0f8e99

Browse files
committed
(MODULES-5546) add version check for pw_hash
Older versions of Puppet end up choking on the sensitive data type check in the pw_hash function added in 42d4ea7. this adds a version check so if the version is older than 4.6.0 when sensitive types were introduced, the check is skipped.
1 parent 1db550a commit a0f8e99

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/puppet/parser/functions/pw_hash.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
are compatible before using this function.") do |args|
2929
raise ArgumentError, "pw_hash(): wrong number of arguments (#{args.size} for 3)" if args.size != 3
3030
args.map! do |arg|
31-
if arg.is_a? Puppet::Pops::Types::PSensitiveType::Sensitive
31+
if (Puppet::Util::Package.versioncmp(Puppet.version, '4.6.0') >= 0) && (arg.is_a? Puppet::Pops::Types::PSensitiveType::Sensitive)
3232
arg.unwrap
3333
else
3434
arg

0 commit comments

Comments
 (0)