summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/fqdn_rand.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/parser/functions/fqdn_rand.rb b/lib/puppet/parser/functions/fqdn_rand.rb
index 52946f2c1..91157a148 100644
--- a/lib/puppet/parser/functions/fqdn_rand.rb
+++ b/lib/puppet/parser/functions/fqdn_rand.rb
@@ -5,8 +5,8 @@ Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc =>
$random_number = fqdn_rand(30)
$random_number_seed = fqdn_rand(30,30)") do |args|
- require 'md5'
+ require 'digest/md5'
max = args.shift
- srand MD5.new([lookupvar('fqdn'),args].join(':')).to_s.hex
+ srand(Digest::MD5.hexdigest([lookupvar('fqdn'),args].join(':')).hex)
rand(max).to_s
end