276: def evaluate
277: @count = 0
278:
279:
280: Puppet::Util::Log.newdestination(@report)
281:
282: prepare()
283:
284: Puppet.info "Applying configuration version '%s'" % catalog.version if catalog.version
285:
286: begin
287: allevents = @sorted_resources.collect { |resource|
288: if resource.is_a?(Puppet::Type::Component)
289: Puppet.warning "Somehow left a component in the relationship graph"
290: next
291: end
292: ret = nil
293: seconds = thinmark do
294: ret = eval_resource(resource)
295: end
296:
297: if Puppet[:evaltrace] and @catalog.host_config?
298: resource.info "Evaluated in %0.2f seconds" % seconds
299: end
300: ret
301: }.flatten.reject { |e| e.nil? }
302: ensure
303:
304: Puppet::Util::Log.close(@report)
305: end
306:
307: Puppet.debug "Finishing transaction %s with %s changes" %
308: [self.object_id, @count]
309:
310: @events = allevents
311: allevents
312: end