Skip to content

Commit

Permalink
Modified format of times sent to json report handler
Browse files Browse the repository at this point in the history
so activesupport does not alter json output
  • Loading branch information
mmzyk committed Mar 6, 2012
1 parent 9bbc717 commit e70a6ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion chef/lib/chef/handler/json_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ def report
build_report_dir
savetime = Time.now.strftime("%Y%m%d%H%M%S")
File.open(File.join(config[:path], "chef-run-report-#{savetime}.json"), "w") do |file|
file.puts Chef::JSONCompat.to_json_pretty(data)

#ensure start time and end time are output in the json properly in the event activesupport happens to be on the system
run_data = data
run_data[:start_time] = run_data[:start_time].to_s
run_data[:end_time] = run_data[:end_time].to_s

file.puts Chef::JSONCompat.to_json_pretty(run_data)
end
end

Expand Down

0 comments on commit e70a6ae

Please sign in to comment.