summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppet.com>2017-07-20 12:41:32 -0700
committerHunter Haugen <hunter@puppet.com>2017-07-20 12:41:32 -0700
commit1b30d0d98ec93a01b3ff78246147e63d670dcbbb (patch)
treef8210d3cae74938b3f72423e68f8bacb092bbb41 /lib
parent27003b7b2de5021c512b094050de9063f0f3a134 (diff)
parent42d4ea7af9197f77a3062727eb166c719ca6296a (diff)
Merge pull request #791 from eputnam/MODULES-4908
(MODULES-4908) adds support for sensitive data type to pw_hash
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/parser/functions/pw_hash.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/pw_hash.rb b/lib/puppet/parser/functions/pw_hash.rb
index d99ee5b..0deeb3a 100644
--- a/lib/puppet/parser/functions/pw_hash.rb
+++ b/lib/puppet/parser/functions/pw_hash.rb
@@ -27,6 +27,13 @@ Puppet::Parser::Functions::newfunction(
environment contains several different operating systems, ensure that they
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
+ arg.unwrap
+ else
+ arg
+ end
+ end
raise ArgumentError, "pw_hash(): first argument must be a string" unless args[0].is_a? String or args[0].nil?
raise ArgumentError, "pw_hash(): second argument must be a string" unless args[1].is_a? String
hashes = { 'md5' => '1',