Skip to content

Commit

Permalink
Merge pull request #247 from alexjfisher/fix_redefined_entity
Browse files Browse the repository at this point in the history
Fix `remove_resource` `Attempt to redefine entity`
  • Loading branch information
alexjfisher authored Feb 18, 2025
2 parents 4224ae4 + 8aebee8 commit 611c841
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/puppet/functions/extlib/remove_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def remove_resources(scope, resources, soft_fail = nil)
end

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

if catalog_resource
# To remove the resource, we reverse the actions from compiler.add_resource
Expand Down

0 comments on commit 611c841

Please sign in to comment.