Skip to content

Commit 3fafad8

Browse files
committed
Merge pull request #460 from DavidS/fix-fqdn_rotate-seed
fqdn_rotate: reset srand seed correctly on old ruby versions
2 parents 6cf64f1 + 0dc0e0d commit 3fafad8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/puppet/parser/functions/fqdn_rotate.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ module Puppet::Parser::Functions
3939
if defined?(Random) == 'constant' && Random.class == Class
4040
offset = Random.new(seed).rand(elements)
4141
else
42-
srand(seed)
42+
old_seed = srand(seed)
4343
offset = rand(elements)
44-
srand()
44+
srand(old_seed)
4545
end
4646
end
4747
offset.times {

0 commit comments

Comments
 (0)