Bug 468378

Summary: Disabling available Node produces TemplateError
Product: [Community] Virtualization Tools Reporter: Alan Pevec <apevec>
Component: ovirt-server-suiteAssignee: Scott Seago <sseago>
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: unspecifiedCC: kraxel, ovirt-bugs, ovirt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-21 17:18:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch url attached none

Description Alan Pevec 2008-10-24 13:52:03 UTC
Description of problem:
For _available_ Node, choosing "Disable Host" action in Node details succeeds, Node is marked as (disabled) in Status table column but yellow notification with "500" pops up and disabled Node detail view doesn't render, re-enabling is not possible since "Enable Host" action is available only in Node details.

In rails.log TemplateError is reported:
Processing HostController#show (for 192.168.50.1 at 2008-10-24 13:35:30) [GET]
  Session ID: a184e5d2427ce1c62b52b453a00d530a
  Parameters: {"action"=>"show", "id"=>"1", "controller"=>"host"}
Rendering template within layouts/selection
Rendering host/show
ActionView::TemplateError (undefined method `consuming_resources' for #<Class:0x7fef61162f58>) on line #15 of host/show.rhtml:
12:         <%= image_tag "icon_suspend.png" %> Disable Host
13:       </a> 
14:     <% end -%>
15:     <%if @host.is_clear_task_valid? -%>
16:       <a href="#" onClick="host_action('clear_vms')">
17:         <%= image_tag "icon_x.png" %> Clear VMs
18:       </a> 
...
    app/models/host.rb:78:in `is_clear_task_valid?'
    app/views/host/show.rhtml:15:in `_run_erb_47app47views47host47show46rhtml'
...

Doesn't happen for _unavailable_ Nodes.


Version-Release number of selected component (if applicable):
ovirt-server-0.94.4

How reproducible:
always

Steps to Reproduce:
1. see above
2.
3.
  
Actual results:
500 error notification, Node details doesn't render

Expected results:
Node details is rendered w/o error

Additional info:

Comment 1 Alan Pevec 2008-11-08 20:12:07 UTC
*** Bug 470528 has been marked as a duplicate of this bug. ***

Comment 2 Scott Seago 2009-01-20 18:39:58 UTC
A prior refactoring removed the 'do' and 'end' around an association method -- this patch restores it.

Comment 3 Scott Seago 2009-01-20 18:41:11 UTC
Created attachment 329498 [details]
patch url attached