summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@rimspace.net>2011-08-12 06:29:46 -0700
committerDaniel Pittman <daniel@rimspace.net>2011-08-12 06:29:46 -0700
commita71573cb32f01e5bf5f1a5030c6a291ce5b63370 (patch)
tree086456552bd58d449e61a6617380b87a0560025f
parenteee90dd5036c0627ab83c7a39c53d4ca3f0affc3 (diff)
parentd3c747b3c22be2592267071075facaaad498a82b (diff)
downloadpuppet-a71573cb32f01e5bf5f1a5030c6a291ce5b63370.tar.gz
Merge pull request #34 from nanliu/ticket/2.7.x/8814
(#8814) Update fqdn_rand for ruby 1.9.2 rand bug.
-rw-r--r--lib/puppet/parser/functions/fqdn_rand.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/fqdn_rand.rb b/lib/puppet/parser/functions/fqdn_rand.rb
index 668802e73..3b1df6d95 100644
--- a/lib/puppet/parser/functions/fqdn_rand.rb
+++ b/lib/puppet/parser/functions/fqdn_rand.rb
@@ -6,7 +6,7 @@ Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc =>
$random_number = fqdn_rand(30)
$random_number_seed = fqdn_rand(30,30)") do |args|
require 'digest/md5'
- max = args.shift
+ max = args.shift.to_i
srand(Digest::MD5.hexdigest([self['::fqdn'],args].join(':')).hex)
rand(max).to_s
end