lib/puppet/resource/catalog.rb
def remove_resource(*resources)
    resources.each do |resource|
      ref = resource.ref
      title_key = title_key_for_ref(ref)
      @resource_table.delete(title_key)
      if aliases = @aliases[ref]
        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
# 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.
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.
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 .
def remove_resource(*resources)
    resources.each do |resource|
      ref = resource.ref
      title_key = title_key_for_ref(ref)
      @resource_table.delete(title_key)
      if aliases = @aliases[ref]
        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)
      resource.remove if resource.respond_to?(:remove)
    end
  end
def remove_resource ( * resources ) resources . each do | resource | ref = resource . ref title_key = title_key_for_ref ( ref ) @resource_table . delete ( title_key ) if aliases = @aliases [ ref ] 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 ) resource . remove if resource . respond_to? ( :remove ) end end
Remove the resource from our catalog.
Remove the resource from our catalog .
# Only Puppet::Type kind of resources respond to :remove, not Puppet::Resource
resources