Navigation Menu

Skip to content

Commit

Permalink
added a sort to the list of nodes per cookbook to make future compari…
Browse files Browse the repository at this point in the history
…sons easier
  • Loading branch information
aglarond committed Jan 18, 2013
1 parent 0a5b303 commit f4d0110
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/chef/knife/audit.rb
Expand Up @@ -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|
Expand All @@ -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|
Expand All @@ -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|
Expand Down

0 comments on commit f4d0110

Please sign in to comment.