From a0c038f900ac266ae3cb7f75b3d648bc3cf212f8 Mon Sep 17 00:00:00 2001 From: Christopher Bowman Date: Thu, 6 Oct 2016 15:34:02 -0400 Subject: [PATCH] Perform the output_report when two directories are being compared When output_report is enabled and two directories are being compared, there was no invocation of the output_report. --- lib/puppet/face/catalog/diff.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/puppet/face/catalog/diff.rb b/lib/puppet/face/catalog/diff.rb index d2f6499..161ed95 100644 --- a/lib/puppet/face/catalog/diff.rb +++ b/lib/puppet/face/catalog/diff.rb @@ -175,6 +175,15 @@ nodes[:most_differences] = most_differences.reverse.take((options.has_key?(:changed_depth) && options[:changed_depth].to_i || 10)) nodes[:total_nodes] = total_nodes nodes[:date] = Time.new.iso8601 + + # Save the file as it can take a while to create + if options[:output_report] + Puppet.notice("Writing report to disk: #{options[:output_report]}") + File.open(options[:output_report],"w") do |f| + f.write(nodes.to_json) + end + end + nodes end