Reviewed-By: Mike Stahnke

Signed-off-by: Pieter van de Bruggen <[email protected]>
---
Local-branch: tickets/1.2rc/8589
 app/views/reports/_resource_statuses.html.haml |    2 +-
 lib/core_callbacks.rb                          |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/views/reports/_resource_statuses.html.haml 
b/app/views/reports/_resource_statuses.html.haml
index d3ea038..d862706 100644
--- a/app/views/reports/_resource_statuses.html.haml
+++ b/app/views/reports/_resource_statuses.html.haml
@@ -7,7 +7,7 @@
       %dl.expandable-list
         - statuses.each do |status, resources|
           %h3 #{status.titleize} (#{resources.count})
-          - resources.sort_by(&:time).each do |status|
+          - resources.each do |status|
             - index += 1
             %dt{:class => cycle( 'odd', 'even' )}
               - if status.events.empty?
diff --git a/lib/core_callbacks.rb b/lib/core_callbacks.rb
index 9ba3c24..2fd8b07 100644
--- a/lib/core_callbacks.rb
+++ b/lib/core_callbacks.rb
@@ -37,9 +37,9 @@ end
 
 # Report view widgets
 Registry.add_callback :core, :report_view_widgets, "800_resource_statuses" do 
|view_renderer, report|
-  statuses = report.resource_statuses.group_by(&:status).sort
-  if failed = statuses.index {|s,rs| s == 'failed'} then 
statuses.unshift(statuses.delete_at(failed)) end
-  view_renderer.render 'reports/resource_statuses', :report => report, 
:statuses => statuses
+  statuses = report.resource_statuses.all(:order => 'resource_type, 
title').group_by(&:status)
+  statuses = %w[failed pending changed unchanged].map { |k| (v = statuses[k]) 
&& [k, v] }
+  view_renderer.render 'reports/resource_statuses', :report => report, 
:statuses => statuses.compact
 end
 
 Registry.add_callback :core, :report_view_widgets, "700_log" do 
|view_renderer, report|
-- 
1.7.5.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to