summaryrefslogtreecommitdiff
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorEric Putnam <putnam.eric@gmail.com>2017-08-28 09:34:27 -0700
committerEric Putnam <putnam.eric@gmail.com>2017-08-28 10:50:10 -0700
commitb1071e486578c63a4d93911585e02be44e9efbed (patch)
tree87efd87d37b69521bbf00ce790dea83991a8b600 /lib/puppet/parser
parent1db550a16c49fb7f2f086d2a46bc666c477ee50d (diff)
(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.
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/functions/pw_hash.rb2
1 files changed, 1 insertions, 1 deletions
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