chef/lib/chef/run_context.rb
# Used to load the node's recipes after expanding its run list
Used to load the node's recipes after expanding its run list
Used to load the node ' s recipes after expanding its run list
def load_resource_definitions
      @events.definition_load_start(count_files_by_segment(:definitions))
      foreach_cookbook_load_segment(:definitions) do |cookbook_name, filename|
        begin
          Chef::Log.debug("Loading cookbook #{cookbook_name}'s definitions from #{filename}")
          resourcelist = Chef::ResourceDefinitionList.new
          resourcelist.from_file(filename)
          definitions.merge!(resourcelist.defines) do |key, oldval, newval|
            Chef::Log.info("Overriding duplicate definition #{key}, new definition found in #{filename}")
            newval
          end
          @events.definition_file_loaded(filename)
        rescue Exception => e
          @events.definition_file_load_failed(filename, e)
        end
      end
      @events.definition_load_complete
    end
def load_resource_definitions @events . definition_load_start ( count_files_by_segment ( :definitions ) ) foreach_cookbook_load_segment ( :definitions ) do | cookbook_name , filename | begin Chef :: Log . debug ( "Loading cookbook #{cookbook_name}'s definitions from #{filename}" ) resourcelist = Chef :: ResourceDefinitionList . new resourcelist . from_file ( filename ) definitions . merge! ( resourcelist . defines ) do | key , oldval , newval | Chef :: Log . info ( "Overriding duplicate definition #{key}, new definition found in #{filename}" ) newval end @events . definition_file_loaded ( filename ) rescue Exception => e @events . definition_file_load_failed ( filename , e ) end end @events . definition_load_complete end
Used to load the node's recipes after expanding its run list
Used to load the node ' s recipes after expanding its run list