Method: Puppet::Type#managed?

Defined in:
lib/puppet/type.rb

#managed?Boolean

Note:

An object that is managed always stays managed, but an object that is not managed may become managed later in its lifecycle.

Returns true if the instance is a managed instance. A ‘yes’ here means that the instance was created from the language, vs. being created in order resolve other questions, such as finding a package in a list.

Returns:

  • (Boolean)

    true if the object is managed



954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
# File 'lib/puppet/type.rb', line 954

def managed?
  # Once an object is managed, it always stays managed; but an object
  # that is listed as unmanaged might become managed later in the process,
  # so we have to check that every time
  unless @managed
    @managed = false
    properties.each { |property|
      s = property.should
      if s and !property.class.unmanaged
        @managed = true
        break
      end
    }
  end
  @managed
end