diff --git a/lib/puppet/functions/extlib/remove_resource.rb b/lib/puppet/functions/extlib/remove_resource.rb index 7891274..c14136c 100644 --- a/lib/puppet/functions/extlib/remove_resource.rb +++ b/lib/puppet/functions/extlib/remove_resource.rb @@ -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