lib/puppet/provider/transition/ruby.rb
def resolve_resource(reference)
    if reference.is_a?(Puppet::Type)
      # Probably from a unit test, use the resource as-is
      return reference
    end

    if reference.is_a?(Puppet::Resource)
      # Already part resolved - puppet apply?
      # join it to the catalog where we live and ask it to resolve
      reference.catalog = resource.catalog
      return reference.resolve
    end

    if reference.is_a?(String)
      # 3.3.0 catalogs you need to resolve like so
      return resource.catalog.resource(reference)
    end

    # If we got here, panic
    raise "Don't know how to convert '#{reference.inspect}' of class #{reference.class} into a resource"
  end
# This method borrowed from the richardc/datacat module
This method borrowed from the richardc/datacat module
This method borrowed from the richardc / datacat module
def resolve_resource(reference)
    if reference.is_a?(Puppet::Type)
      return reference
    end
    if reference.is_a?(Puppet::Resource)
      reference.catalog = resource.catalog
      return reference.resolve
    end
    if reference.is_a?(String)
      return resource.catalog.resource(reference)
    end
    raise "Don't know how to convert '#{reference.inspect}' of class #{reference.class} into a resource"
  end
def resolve_resource ( reference ) if reference . is_a? ( Puppet :: Type ) return reference end if reference . is_a? ( Puppet :: Resource ) reference . catalog = resource . catalog return reference . resolve end if reference . is_a? ( String ) return resource . catalog . resource ( reference ) end raise "Don't know how to convert '#{reference.inspect}' of class #{reference.class} into a resource" end
This method borrowed from the richardc/datacat module
This method borrowed from the richardc / datacat module
# Probably from a unit test, use the resource as-is # Already part resolved - puppet apply? # join it to the catalog where we live and ask it to resolve # 3.3.0 catalogs you need to resolve like so # If we got here, panic
reference