Permalink
Browse files

added a sort to the list of nodes per cookbook to make future compari…

…sons easier
  • Loading branch information...
1 parent 0a5b303 commit f4d0110c5072722c52bddb7d53c3021a03f035f0 @aglarond aglarond committed Jan 18, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/chef/knife/audit.rb
View
@@ -200,7 +200,7 @@ def format_cookbook_runlist_list_for_display(item)
key_length = item.empty? ? 0 : item.keys.map {|name| name.size }.max + 2
if config[:show_nodelist]
item.sort.map do |name, cookbook|
- "#{name.ljust(key_length)} #{cookbook["count"]} [ #{cookbook["nodes"].join(' ')} ]"
+ "#{name.ljust(key_length)} #{cookbook["count"]} [ #{cookbook["nodes"].sort.join(' ')} ]"
end
else
item.sort.map do |name, cookbook|
@@ -214,7 +214,7 @@ def format_cookbook_seenlist_list_for_display(item)
key_length = item.empty? ? 0 : item.keys.map {|name| name.size }.max + 2
if config[:show_nodelist]
item.sort.map do |name, cookbook|
- "#{name.ljust(key_length)} #{cookbook["seen_recipe_count"]} [ #{cookbook["seen_recipe_nodes"].join(' ')} ]"
+ "#{name.ljust(key_length)} #{cookbook["seen_recipe_count"]} [ #{cookbook["seen_recipe_nodes"].sort.join(' ')} ]"
end
else
item.sort.map do |name, cookbook|
@@ -230,7 +230,7 @@ def format_cookbook_totallist_list_for_display(item)
item.sort.map do |name, cookbook|
cookbook_display = (cookbook["seen_recipe_nodes"] + cookbook["nodes"]).uniq
cookbook_count = cookbook["seen_recipe_count"] + cookbook["count"]
- "#{name.ljust(key_length)} #{cookbook_count} [ #{cookbook_display.join(' ')} ]"
+ "#{name.ljust(key_length)} #{cookbook_count} [ #{cookbook_display.sort.join(' ')} ]"
end
else
item.sort.map do |name, cookbook|

0 comments on commit f4d0110

Please sign in to comment.