summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/fqdn_rotate.rb
diff options
context:
space:
mode:
authorTP Honey <tphoney@users.noreply.github.com>2015-05-26 15:48:22 +0100
committerTP Honey <tphoney@users.noreply.github.com>2015-05-26 15:48:22 +0100
commit3fafad88b3ccec89a8e988b84b55611e9f03fc09 (patch)
tree6ea424514044c11258623f26cb380d38d51c8816 /lib/puppet/parser/functions/fqdn_rotate.rb
parent6cf64f1028cbb290a6254b5e753072f65c9336fa (diff)
parent0dc0e0dbcf9574ed1515cf6cfe2800f06d8c1d0e (diff)
downloadpuppet-stdlib-3fafad88b3ccec89a8e988b84b55611e9f03fc09.tar.gz
puppet-stdlib-3fafad88b3ccec89a8e988b84b55611e9f03fc09.tar.bz2
Merge pull request #460 from DavidS/fix-fqdn_rotate-seed
fqdn_rotate: reset srand seed correctly on old ruby versions
Diffstat (limited to 'lib/puppet/parser/functions/fqdn_rotate.rb')
-rw-r--r--lib/puppet/parser/functions/fqdn_rotate.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/parser/functions/fqdn_rotate.rb b/lib/puppet/parser/functions/fqdn_rotate.rb
index cf22d36..d9741a0 100644
--- a/lib/puppet/parser/functions/fqdn_rotate.rb
+++ b/lib/puppet/parser/functions/fqdn_rotate.rb
@@ -39,9 +39,9 @@ Rotates an array a random number of times based on a nodes fqdn.
if defined?(Random) == 'constant' && Random.class == Class
offset = Random.new(seed).rand(elements)
else
- srand(seed)
+ old_seed = srand(seed)
offset = rand(elements)
- srand()
+ srand(old_seed)
end
end
offset.times {