From b5d0f72d37a58948f45c920caaa39a4a9c90cf44 Mon Sep 17 00:00:00 2001 From: Alexander Fisher Date: Mon, 3 Aug 2020 20:45:31 +0100 Subject: [PATCH] Include list of `all_changed_nodes` in json report (#34) Currently, `puppet-catalog-diff-viewer` only looks at the nodes in `most_differences` to decide which nodes to display as 'with changes' and 'no changes'. By default, this list is limited to just 10 nodes with the most differences. Including a complete list of changed nodes in the json (regardless of `--changed_depth`) will make fixing puppet-catalog-diff-viewer much easier. --- lib/puppet/face/catalog/diff.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/puppet/face/catalog/diff.rb b/lib/puppet/face/catalog/diff.rb index 4b4d6dd..f6cb3be 100644 --- a/lib/puppet/face/catalog/diff.rb +++ b/lib/puppet/face/catalog/diff.rb @@ -204,6 +204,7 @@ nodes[:most_differences] = most_differences.reverse.take((options.key?(:changed_depth) && options[:changed_depth].to_i || 10)) nodes[:total_nodes] = total_nodes nodes[:date] = Time.new.iso8601 + nodes[:all_changed_nodes] = with_changes.keys nodes end @@ -212,7 +213,7 @@ format = Puppet::CatalogDiff::Formater.new nodes.map { |node, summary| - next if [:total_percentage, :total_nodes, :most_changed, :with_changes, :most_differences, :pull_output, :date].include?(node) + next if [:total_percentage, :total_nodes, :most_changed, :with_changes, :most_differences, :pull_output, :date, :all_changed_nodes].include?(node) format.node_summary_header(node, summary, :node_percentage) + summary.map { |header, value| next if value.nil?