Skip to content

Commit e2c361d

Browse files
committed
troubleshooting
1 parent 564cf4b commit e2c361d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/puppet/parser/functions/fqdn_rotate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
elements = result.size
4040

41-
seed = Digest::MD5.hexdigest([lookupvar('facts'), args].join(':')).hex
41+
seed = Digest::MD5.hexdigest([lookupvar("facts['networking']['fqdn']"), args].join(':')).hex
4242
# deterministic_rand() was added in Puppet 3.2.0; reimplement if necessary
4343
if Puppet::Util.respond_to?(:deterministic_rand)
4444
offset = Puppet::Util.deterministic_rand(seed, elements).to_i

spec/functions/fqdn_rand_string_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def fqdn_rand_string(max, args = {})
5757

5858
# workaround not being able to use let(:facts) because some tests need
5959
# multiple different hostnames in one context
60-
allow(scope).to receive(:lookupvar).with('facts', {}).and_return(host)
60+
allow(scope).to receive(:lookupvar).with("facts['networking']['fqdn']", {}).and_return(host)
6161

6262
function_args = [max]
6363
if args.key?(:charset) || !extra.empty?

spec/functions/fqdn_rotate_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def fqdn_rotate(value, args = {})
6868

6969
# workaround not being able to use let(:facts) because some tests need
7070
# multiple different hostnames in one context
71-
allow(scope).to receive(:lookupvar).with('facts').and_return(host)
71+
allow(scope).to receive(:lookupvar).with("facts['networking']['fqdn']").and_return(host)
7272

7373
function_args = [value] + extra
7474
scope.function_fqdn_rotate(function_args)

spec/functions/seeded_rand_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def seeded_rand(max, seed, args = {})
4848

4949
# workaround not being able to use let(:facts) because some tests need
5050
# multiple different hostnames in one context
51-
allow(scope).to receive(:lookupvar).with('facts', {}).and_return(host)
51+
allow(scope).to receive(:lookupvar).with("facts['networking']['fqdn']", {}).and_return(host)
5252

5353
scope.function_seeded_rand([max, seed])
5454
end

0 commit comments

Comments
 (0)