# File lib/puppet/reports/store.rb, line 11
11:   def process
12:     # We don't want any tracking back in the fs.  Unlikely, but there
13:     # you go.
14:     client = self.host.gsub("..",".")
15: 
16:     dir = File.join(Puppet[:reportdir], client)
17: 
18:     Dir.mkdir(dir, 0750) unless FileTest.exists?(dir)
19: 
20:     # Now store the report.
21:     now = Time.now.gmtime
22:     name = %w{year month day hour min}.collect do |method|
23:       # Make sure we're at least two digits everywhere
24:       "%02d" % now.send(method).to_s
25:     end.join("") + ".yaml"
26: 
27:     file = File.join(dir, name)
28: 
29:     begin
30:       File.open(file, "w", 0640) do |f|
31:         f.print to_yaml
32:       end
33:     rescue => detail
34:       puts detail.backtrace if Puppet[:trace]
35:       Puppet.warning "Could not write report for #{client} at #{file}: #{detail}"
36:     end
37: 
38:     # Only testing cares about the return value
39:     file
40:   end