Skip to content

Commit b1071e4

Browse files
committed
(MODULES-5546) add 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 check for the Sensitive class and then the type of the arg, so that if the class has not been declared, it will just move on.
1 parent 1db550a commit b1071e4

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 (defined? Puppet::Pops::Types::PSensitiveType::Sensitive) && (arg.is_a? Puppet::Pops::Types::PSensitiveType::Sensitive)
3232
arg.unwrap
3333
else
3434
arg

0 commit comments

Comments
 (0)