Bug 1284014 - Don't have ability to add a new chargeback rate
Don't have ability to add a new chargeback rate
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS (Show other bugs)
5.5.0
Unspecified Unspecified
medium Severity medium
: GA
: 5.6.0
Assigned To: Milan Zázrivec
Taras Lehinevych
chargeback
: ZStream
Depends On:
Blocks: 1289280
  Show dependency treegraph
 
Reported: 2015-11-20 09:38 EST by Taras Lehinevych
Modified: 2016-08-02 21:32 EDT (History)
9 users (show)

See Also:
Fixed In Version: 5.6.0.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1289280 (view as bug list)
Environment:
Last Closed: 2016-06-29 11:04:45 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)


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 Taras Lehinevych 2015-11-20 09:38:06 EST
Description of problem:
If you delete all the chargeback rates under Storage or Compute you won't have an option how to add a new one

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

How reproducible:
100%

Steps to Reproduce:
1. Go to Chargeback -> Rates
2. Delete all chargeback rates under Storage 

Actual results:
The Storage disappeared from navigation tree and also you can't open it via Rates, so you don't have ability to add a new chargeback rate for Storage.

Expected results:
The Storage should be displayed and when you open it just displayed the empty list of rates, in this case the customer could click on Configuration -> Add a new Chargeback Rate button

Additional info:
The same with Compute
Comment 5 Milan Zázrivec 2015-11-26 06:02:48 EST
https://github.com/ManageIQ/manageiq/pull/5619
Comment 6 CFME Bot 2015-12-03 10:53:54 EST
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/636466c24964f844cb6fb375897e278d77b54db3

commit 636466c24964f844cb6fb375897e278d77b54db3
Author:     Milan Zazrivec <mzazrivec@redhat.com>
AuthorDate: Thu Nov 26 11:46:21 2015 +0100
Commit:     Milan Zazrivec <mzazrivec@redhat.com>
CommitDate: Thu Dec 3 10:51:37 2015 +0100

    Chargeback rates: correctly render tree nodes with no cb rates
    
    Chargeback rates tree builder needs to be able to create / render
    storage and compute tree nodes even when there are no chargeback
    rates available in the database.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1284014

 app/presenters/tree_builder_chargeback_assignments.rb  |  3 +--
 app/presenters/tree_builder_chargeback_rates.rb        |  3 +--
 spec/presenters/tree_builder_chargeback_assignments.rb | 16 ++++++++++++++++
 spec/presenters/tree_builder_chargeback_rates_spec.rb  | 16 ++++++++++++++++
 spec/presenters/tree_builder_spec.rb                   | 11 ++++++++++-
 5 files changed, 44 insertions(+), 5 deletions(-)
 create mode 100644 spec/presenters/tree_builder_chargeback_assignments.rb
 create mode 100644 spec/presenters/tree_builder_chargeback_rates_spec.rb
Comment 7 CFME Bot 2015-12-03 10:55:28 EST
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/636466c24964f844cb6fb375897e278d77b54db3

commit 636466c24964f844cb6fb375897e278d77b54db3
Author:     Milan Zazrivec <mzazrivec@redhat.com>
AuthorDate: Thu Nov 26 11:46:21 2015 +0100
Commit:     Milan Zazrivec <mzazrivec@redhat.com>
CommitDate: Thu Dec 3 10:51:37 2015 +0100

    Chargeback rates: correctly render tree nodes with no cb rates
    
    Chargeback rates tree builder needs to be able to create / render
    storage and compute tree nodes even when there are no chargeback
    rates available in the database.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1284014

 app/presenters/tree_builder_chargeback_assignments.rb  |  3 +--
 app/presenters/tree_builder_chargeback_rates.rb        |  3 +--
 spec/presenters/tree_builder_chargeback_assignments.rb | 16 ++++++++++++++++
 spec/presenters/tree_builder_chargeback_rates_spec.rb  | 16 ++++++++++++++++
 spec/presenters/tree_builder_spec.rb                   | 11 ++++++++++-
 5 files changed, 44 insertions(+), 5 deletions(-)
 create mode 100644 spec/presenters/tree_builder_chargeback_assignments.rb
 create mode 100644 spec/presenters/tree_builder_chargeback_rates_spec.rb
Comment 8 Taras Lehinevych 2016-04-19 06:38:43 EDT
Failed verification on 5.6.0.1-beta2

Delete the Default rate from Compute, then press Configuration  -> Add new Chargeback Rate and as a result you will get Unexpected error encountered page. The same is for Storage.

production.log
FATAL -- : Error caught: [NoMethodError] undefined method `chargeback_rate_detail_currency_id' for nil:NilClass
Comment 9 Milan Zázrivec 2016-04-19 09:23:42 EDT
Fair enough, although what you're showing in comment #8 is a slightly
different problem than what was described in the initial comment.

I created a pull request which wouldn't allow deletion of default
chargeback rates (causing the problem you found):

https://github.com/ManageIQ/manageiq/pull/8086
Comment 10 CFME Bot 2016-04-20 07:20:54 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/a647f6b8e4a62ef4113d9471fbef4c4fb06e1a9d

commit a647f6b8e4a62ef4113d9471fbef4c4fb06e1a9d
Author:     Milan Zazrivec <mzazrivec@redhat.com>
AuthorDate: Tue Apr 19 15:20:04 2016 +0200
Commit:     Milan Zazrivec <mzazrivec@redhat.com>
CommitDate: Tue Apr 19 17:22:28 2016 +0200

    Don't allow deletion of default chargeback rates
    
    Default chargeback rates are seeded during database initialization
    and their deletion results into several problems propagated into
    UI (in several places we assume existence of these default rates).
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1284014

 app/controllers/chargeback_controller.rb                  |  7 +++++++
 .../application_helper/button/chargeback_rate_edit.rb     |  9 +++++++++
 .../application_helper/button/chargeback_rate_remove.rb   |  9 +++++++++
 .../application_helper/toolbar/chargeback_center.rb       |  6 ++++--
 app/models/chargeback_rate.rb                             |  8 ++++++++
 spec/models/chargeback_rate_spec.rb                       | 15 +++++++++++++++
 6 files changed, 52 insertions(+), 2 deletions(-)
 create mode 100644 app/helpers/application_helper/button/chargeback_rate_edit.rb
 create mode 100644 app/helpers/application_helper/button/chargeback_rate_remove.rb
Comment 11 Taras Lehinevych 2016-04-27 09:17:32 EDT
Verified in 5.6.0.4-beta2.3
Comment 14 errata-xmlrpc 2016-06-29 11:04:45 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.