diff options
author | Hunter Haugen <hunter@puppet.com> | 2017-07-20 12:41:32 -0700 |
---|---|---|
committer | Hunter Haugen <hunter@puppet.com> | 2017-07-20 12:41:32 -0700 |
commit | 1b30d0d98ec93a01b3ff78246147e63d670dcbbb (patch) | |
tree | f8210d3cae74938b3f72423e68f8bacb092bbb41 /lib/puppet/parser/functions | |
parent | 27003b7b2de5021c512b094050de9063f0f3a134 (diff) | |
parent | 42d4ea7af9197f77a3062727eb166c719ca6296a (diff) |
Merge pull request #791 from eputnam/MODULES-4908
(MODULES-4908) adds support for sensitive data type to pw_hash
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r-- | lib/puppet/parser/functions/pw_hash.rb | 7 |
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', |