Skip to content

Commit 32e5a87

Browse files
hunnerHelen Campbell
authored andcommitted
(PE-20308) Also fix defined type strings & references
1 parent 9244c67 commit 32e5a87

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/puppet/parser/functions/defined_with_params.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# Workaround for PE-20308
3030
if reference.is_a?(String)
3131
type_name, title = Puppet::Resource.type_and_title(reference, nil)
32-
type = Puppet::Type.type(type_name)
32+
type = Puppet::Pops::Evaluator::Runtime3ResourceSupport.find_resource_type_or_class(find_global_scope, type_name)
3333
elsif reference.is_a?(Puppet::Resource)
3434
type = reference.resource_type
3535
title = reference.title

spec/functions/defined_with_params_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,7 @@
6262
end
6363
it { is_expected.to run.with_params('Test::Deftype[foo]', {}).and_return(true) }
6464
it { is_expected.to run.with_params('Test::Deftype[bar]', {}).and_return(false) }
65+
it { is_expected.to run.with_params(Puppet::Resource.new('Test::Deftype[foo]'), {}).and_return(true) }
66+
it { is_expected.to run.with_params(Puppet::Resource.new('Test::Deftype[bar]'), {}).and_return(false) }
6567
end
6668
end

0 commit comments

Comments
 (0)