Bug 1317929 - Rails error "undefined local variable or method `percentage'" for datastore after SSA
Summary: Rails error "undefined local variable or method `percentage'" for datastore a...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.6.0
Assignee: Zita Nemeckova
QA Contact: Martin Kourim
URL:
Whiteboard: ui:smartstate
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-15 14:32 UTC by Vadim Rutkovsky
Modified: 2019-08-06 20:06 UTC (History)
7 users (show)

Fixed In Version: 5.6.0.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-29 15:42:51 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
production.log (17.28 KB, text/plain)
2016-03-15 14:32 UTC, Vadim Rutkovsky
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 0 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 18:50:04 UTC

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


Note You need to log in before you can comment on or make changes to this bug.