From b1071e486578c63a4d93911585e02be44e9efbed Mon Sep 17 00:00:00 2001 From: Eric Putnam Date: Mon, 28 Aug 2017 09:34:27 -0700 Subject: (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 42d4ea7af9197f77a3062727eb166c719ca6296a. 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. --- lib/puppet/parser/functions/pw_hash.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/parser/functions') diff --git a/lib/puppet/parser/functions/pw_hash.rb b/lib/puppet/parser/functions/pw_hash.rb index 0deeb3a..adcc719 100644 --- a/lib/puppet/parser/functions/pw_hash.rb +++ b/lib/puppet/parser/functions/pw_hash.rb @@ -28,7 +28,7 @@ Puppet::Parser::Functions::newfunction( are compatible before using this function.") do |args| raise ArgumentError, "pw_hash(): wrong number of arguments (#{args.size} for 3)" if args.size != 3 args.map! do |arg| - if arg.is_a? Puppet::Pops::Types::PSensitiveType::Sensitive + if (defined? Puppet::Pops::Types::PSensitiveType::Sensitive) && (arg.is_a? Puppet::Pops::Types::PSensitiveType::Sensitive) arg.unwrap else arg -- cgit v1.2.3