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:
commit
3fafad88b3
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue