Method: Puppet::Resource::Catalog#remove_resource
- Defined in:
- lib/puppet/resource/catalog.rb
#remove_resource(*resources) ⇒ Object
Remove the resource from our catalog. Notice that we also call ‘remove’ on the resource, at least until resource classes no longer maintain references to the resource instances.
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
# File 'lib/puppet/resource/catalog.rb', line 359 def remove_resource(*resources) resources.each do |resource| ref = resource.ref title_key = title_key_for_ref(ref) @resource_table.delete(title_key) aliases = @aliases[ref] if aliases aliases.each { |res_alias| @resource_table.delete(res_alias) } @aliases.delete(ref) end remove_vertex!(resource) if vertex?(resource) @relationship_graph.remove_vertex!(resource) if @relationship_graph and @relationship_graph.vertex?(resource) @resources.delete(title_key) # Only Puppet::Type kind of resources respond to :remove, not Puppet::Resource resource.remove if resource.respond_to?(:remove) end end |