Issue #4159 has been updated by Rein Henrichs.

Status changed from Unreviewed to Accepted


----------------------------------------
Bug #4159: When removing all reports NoMethodError in Nodes#index
http://projects.puppetlabs.com/issues/4159

Author: James Turnbull
Status: Accepted
Priority: Normal
Assigned to: 
Category: 
Target version: 1.1
Keywords: 
Branch: 
Affected URL: 


Hi,

After setting up the rails app , running rake reports:import, logging in and 
removing the sample report, I get:

NoMethodError in Nodes#index

Showing app/views/nodes/_nodes.html.haml where line #20 raised:

undefined method `success?' for nil:NilClass
Extracted source (around line #20):

17: %span{:title => node_title_text(n)}
18: = n.reported_at ? n.last_report.success? ? '✔' : '✘' : '?'
19: %td.hostname
20: = link_to h(n.name), n
21: %td.latest_report
22: = n.last_report ? n.last_report.time.to_s(:long) : "Has not reported"
23: - if nodes.respond_to?(:total_pages) && nodes.total_pages > 1
Trace of template inclusion: app/views/nodes/index.html.haml

RAILS_ROOT: /opt/puppet-dashboard

/opt/puppet-dashboard/vendor/rails/activesupport/lib/active_support/whiny_nil.rb:52:in
 method_missing' 
/opt/puppet-dashboard/app/views/nodes/_nodes.html.haml:20:inrun_haml_app47views47nodes47_nodes46html46haml_locals_nodes_object'
 /opt/puppet-dashboard/app/views/nodes/nodes.html.haml:12:in each' 
/opt/puppet-dashboard/app/views/nodes/_nodes.html.haml:12:in_run_haml_app47views47nodes47_nodes46html46haml_locals_nodes_object'
 /opt/puppet-dashboard/app/views/nodes/index.html.haml:15:in 
_run_haml_app47views47nodes47index46html46haml' 
/opt/puppet-dashboard/app/controllers/nodes_controller.rb:9:inindex'

easy fix:

    %td.status{:class => n.status_class}
      %span{:title => node_title_text(n)}
        = ( n.reported_at and !n.last_report.blank? ) ? n.last_report.succes


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to