Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1317929 - Rails error "undefined local variable or method `percentage'" for datastore after SSA
Rails error "undefined local variable or method `percentage'" for datastore a...
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS (Show other bugs)
5.6.0
Unspecified Unspecified
high Severity high
: GA
: 5.6.0
Assigned To: Zita Nemeckova
Martin Kourim
ui:smartstate
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-15 10:32 EDT by Vadim Rutkovsky
Modified: 2016-09-20 00:25 EDT (History)
7 users (show)

See Also:
Fixed In Version: 5.6.0.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-29 11:42:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 14:50:04 EDT

  None (edit)
Description Vadim Rutkovsky 2016-03-15 10:32:12 EDT
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 16:36:05 EDT
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 13:46:18 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/0507c8d061aa8c69003df16c637bfa973f0b0f75

commit 0507c8d061aa8c69003df16c637bfa973f0b0f75
Author:     Zita Nemeckova <znemecko@redhat.com>
AuthorDate: Wed Mar 16 16:15:21 2016 +0100
Commit:     Zita Nemeckova <znemecko@redhat.com>
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 08:47:25 EDT
Verified in 5.6.0.7-beta2.6
Comment 7 errata-xmlrpc 2016-06-29 11:42:51 EDT
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.