summaryrefslogtreecommitdiff
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/functions/length.rb2
-rw-r--r--lib/puppet/parser/functions/pw_hash.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/functions/length.rb b/lib/puppet/functions/length.rb
index 86e735c..5ebd455 100644
--- a/lib/puppet/functions/length.rb
+++ b/lib/puppet/functions/length.rb
@@ -3,7 +3,7 @@ Puppet::Functions.create_function(:length) do
dispatch :length do
param 'Variant[String,Array,Hash]', :value
end
- def length(value)
+ def length(value)
if value.is_a?(String)
result = value.length
elsif value.is_a?(Array) || value.is_a?(Hash)
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