lib/puppet/indirector/indirection.rb in puppet-2.7.18 vs lib/puppet/indirector/indirection.rb in puppet-2.7.19
- old
+ new
@@ -8,10 +8,13 @@
# each of which is a subclass of Puppet::Indirector::Terminus.
class Puppet::Indirector::Indirection
include Puppet::Util::Docs
extend Puppet::Util::Instrumentation::Instrumentable
+ attr_accessor :name, :model
+ attr_reader :termini
+
probe :find, :label => Proc.new { |parent, key, *args| "find_#{parent.name}_#{parent.terminus_class}" }, :data => Proc.new { |parent, key, *args| { :key => key }}
probe :save, :label => Proc.new { |parent, key, *args| "save_#{parent.name}_#{parent.terminus_class}" }, :data => Proc.new { |parent, key, *args| { :key => key }}
probe :search, :label => Proc.new { |parent, key, *args| "search_#{parent.name}_#{parent.terminus_class}" }, :data => Proc.new { |parent, key, *args| { :key => key }}
probe :destroy, :label => Proc.new { |parent, key, *args| "destroy_#{parent.name}_#{parent.terminus_class}" }, :data => Proc.new { |parent, key, *args| { :key => key }}
@@ -33,13 +36,9 @@
# can specifically hook up with the indirections they are associated with.
def self.model(name)
return nil unless match = @@indirections.find { |i| i.name == name }
match.model
end
-
- attr_accessor :name, :model
-
- attr_reader :termini
# Create and return our cache terminus.
def cache
raise(Puppet::DevError, "Tried to cache when no cache class was set") unless cache_class
terminus(cache_class)