Skip to content

Commit

Permalink
Include list of all_changed_nodes in json report (#34)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexjfisher committed Aug 3, 2020
1 parent 967bd3a commit b5d0f72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/puppet/face/catalog/diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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?
Expand Down

0 comments on commit b5d0f72

Please sign in to comment.