Skip to content

Commit a8cf2dc

Browse files
committed
fqdn_rotate: Don't use the value itself as part of the random seed
1 parent c9b810c commit a8cf2dc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/puppet/parser/functions/fqdn_rotate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Puppet::Parser::Functions
1111
raise(Puppet::ParseError, "fqdn_rotate(): Wrong number of arguments " +
1212
"given (#{arguments.size} for 1)") if arguments.size < 1
1313

14-
value = arguments[0]
14+
value = arguments.shift
1515
require 'digest/md5'
1616

1717
unless value.is_a?(Array) || value.is_a?(String)

spec/acceptance/fqdn_rotate_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
EOS
3737

3838
apply_manifest(pp, :catch_failures => true) do |r|
39-
expect(r.stdout).to match(/fqdn_rotate is \["c", "d", "a", "b"\]/)
39+
expect(r.stdout).to match(/fqdn_rotate is \["d", "a", "b", "c"\]/)
4040
end
4141
end
4242
end

spec/functions/fqdn_rotate_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class AlsoString < String
4444
it "should use the Puppet::Util.deterministic_rand function if available" do
4545
scope.expects(:lookupvar).with("::fqdn").returns("127.0.0.1")
4646
if Puppet::Util.respond_to?(:deterministic_rand)
47-
Puppet::Util.expects(:deterministic_rand).with(113646079810780526294648115052177588845,4)
47+
Puppet::Util.expects(:deterministic_rand).with(44489829212339698569024999901561968770,4)
4848
end
4949
scope.function_fqdn_rotate(["asdf"])
5050
end

0 commit comments

Comments
 (0)