Bug 1317929

Summary: Rails error "undefined local variable or method `percentage'" for datastore after SSA
Product: Red Hat CloudForms Management Engine Reporter: Vadim Rutkovsky <vrutkovs>
Component: UI - OPSAssignee: Zita Nemeckova <znemecko>
Status: CLOSED ERRATA QA Contact: Martin Kourim <mkourim>
Severity: high Docs Contact:
Priority: high    
Version: 5.6.0CC: dajohnso, dclarizi, hkataria, jhardy, jprause, mpovolny, obarenbo
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ui:smartstate
Fixed In Version: 5.6.0.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-29 15:42:51 UTC Type: Bug
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
production.log none

Description Vadim Rutkovsky 2016-03-15 14:32:12 UTC
Created attachment 1136613 [details]
production.log

Description of problem:
Datastore details page cannot be opened after SSA - rails error:

undefined local variable or method `percentage' for #<#<Class:0x00000015b160d8>:0x0000000931ff70> [storage/show] 

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


How reproducible:
Always

Steps to Reproduce:
1. Add vsphere provider, setup vddk
2. Add smartproxy role for the server, set credentials for any host with datastore
3. Run SSA on datastore, wait until task finishes and open datastore details

Actual results:

Rails error:
undefined local variable or method `percentage' for #<#<Class:0x00000015b160d8>:0x0000000931ff70> [storage/show] 

Expected results:
Datastore details are displayed

Additional info:

Comment 1 Harpreet Kataria 2016-03-15 20:36:05 UTC
Zita,

there is typo introduced in commit sha: ab3bf215ec1ef22b9916e9ad8757a50cfbab07fc

there are multiple issues/typos:

typo on https://github.com/ManageIQ/manageiq/blob/master/app/helpers/storage_helper/textual_summary.rb#L180

${files} should be %{files} on 
https://github.com/ManageIQ/manageiq/blob/master/app/helpers/storage_helper/textual_summary.rb#L178


#{percentage} should be %{percentage}
https://github.com/ManageIQ/manageiq/blob/master/app/helpers/storage_helper/textual_summary.rb#L196

after fixing all the above, i am still getting an error while trying to go to datastore summary screen:
[----] F, [2016-03-15T15:58:05.073149 #26779:3faa821912cc] FATAL -- : Error caught: [ArgumentError] unnumbered(1) mixed with named
/home/hkataria/.rvm/gems/ruby-2.2.3/gems/fast_gettext-1.0.0/lib/fast_gettext/vendor/string.rb:70:in `%'
/home/hkataria/.rvm/gems/ruby-2.2.3/gems/fast_gettext-1.0.0/lib/fast_gettext/vendor/string.rb:70:in `%'
/home/hkataria/dev/manageiq/app/helpers/storage_helper/textual_summary.rb:182:in `textual_disk_files'

looks like % after %{percentage} in gettext calls is causing an error on 
https://github.com/ManageIQ/manageiq/blob/master/app/helpers/storage_helper/textual_summary.rb#L178
and on next few lines

Comment 3 CFME Bot 2016-03-16 17:46:18 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/0507c8d061aa8c69003df16c637bfa973f0b0f75

commit 0507c8d061aa8c69003df16c637bfa973f0b0f75
Author:     Zita Nemeckova <znemecko>
AuthorDate: Wed Mar 16 16:15:21 2016 +0100
Commit:     Zita Nemeckova <znemecko>
CommitDate: Wed Mar 16 16:15:21 2016 +0100

    BZ1317929 - fixed bug introduced by 6910
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1317929
    
    Solved issue with `%` in gettext

 app/helpers/storage_helper/textual_summary.rb | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comment 5 Taras Lehinevych 2016-05-18 12:47:25 UTC
Verified in 5.6.0.7-beta2.6

Comment 7 errata-xmlrpc 2016-06-29 15:42:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1348