Skip to content

Commit 611c841

Browse files
authored
Merge pull request #247 from alexjfisher/fix_redefined_entity
Fix `remove_resource` `Attempt to redefine entity`
2 parents 4224ae4 + 8aebee8 commit 611c841

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/puppet/functions/extlib/remove_resource.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def remove_resources(scope, resources, soft_fail = nil)
4040
end
4141

4242
def remove_resource(scope, resource, soft_fail = nil)
43-
catalog_resource = scope.catalog.resource(resource.type_name, resource.title)
43+
type = Puppet::Pops::Evaluator::Runtime3ResourceSupport.find_resource_type(scope, resource.type_name)
44+
catalog_resource = scope.compiler.findresource(type, resource.title)
4445

4546
if catalog_resource
4647
# To remove the resource, we reverse the actions from compiler.add_resource

0 commit comments

Comments
 (0)