summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-07-08 09:03:47 +1000
committerJames Turnbull <james@lovedthanlost.net>2008-07-08 09:03:47 +1000
commit6ff9246e44dfd58e4e9e26047487ebb061bfc041 (patch)
treef1dfa8ad0d8aef17ddc513675df54796948d8fc1
parentd899264b8aa250676f1d3f91d2df395741a6d22b (diff)
downloadpuppet-6ff9246e44dfd58e4e9e26047487ebb061bfc041.tar.gz
puppet-6ff9246e44dfd58e4e9e26047487ebb061bfc041.tar.xz
puppet-6ff9246e44dfd58e4e9e26047487ebb061bfc041.zip
Fixed #1396 - Added sha1 function from DavidS to core
-rw-r--r--CHANGELOG4
-rw-r--r--lib/puppet/parser/ast/function.rb2
-rw-r--r--lib/puppet/parser/functions.rb8
3 files changed, 12 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 658784841..1fc17bf00 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
-0.24.?
+0.24.5
+ Fixed #1396 - Added sha1 function from DavidS to core
+
Fixed #1399 - the ldap user provider now knows it can manage
passwords.
diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb
index 63d7c7abf..eb36fa906 100644
--- a/lib/puppet/parser/ast/function.rb
+++ b/lib/puppet/parser/ast/function.rb
@@ -42,7 +42,7 @@ class Puppet::Parser::AST
raise Puppet::DevError, "Invalid function type %s" % @ftype.inspect
end
- # Lastly, check the arity
+ # Lastly, check the parity
end
end
end
diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb
index 8decb8227..51903e919 100644
--- a/lib/puppet/parser/functions.rb
+++ b/lib/puppet/parser/functions.rb
@@ -317,6 +317,14 @@ module Functions
end
output
end
+
+ newfunction(:sha1, :type => :rvalue,
+ :doc => "Returns a SHA1 hash value from a provided string.") do |args|
+ require 'sha1'
+
+ Digest::SHA1.hexdigest(args[0])
+ end
+
end
end