Merge pull request #460 from DavidS/fix-fqdn_rotate-seed

fqdn_rotate: reset srand seed correctly on old ruby versions
This commit is contained in:
TP Honey 2015-05-26 15:48:22 +01:00
commit 3fafad88b3

View file

@ -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 {