Bug 1284014 - Don't have ability to add a new chargeback rate
Summary: Don't have ability to add a new chargeback rate
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.5.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.6.0
Assignee: Milan Zázrivec
QA Contact: Taras Lehinevych
URL:
Whiteboard: chargeback
Depends On:
Blocks: 1289280
TreeView+ depends on / blocked
 
Reported: 2015-11-20 14:38 UTC by Taras Lehinevych
Modified: 2016-08-03 01:32 UTC (History)
9 users (show)

Fixed In Version: 5.6.0.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1289280 (view as bug list)
Environment:
Last Closed: 2016-06-29 15:04:45 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1206285 0 medium CLOSED CFME allows deletion of default compute and storage chargeback rates 2021-02-22 00:41:40 UTC
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

Internal Links: 1206285

Description Taras Lehinevych 2015-11-20 14:38:06 UTC
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 11:02:48 UTC
https://github.com/ManageIQ/manageiq/pull/5619

Comment 6 CFME Bot 2015-12-03 15:53:54 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/636466c24964f844cb6fb375897e278d77b54db3

commit 636466c24964f844cb6fb375897e278d77b54db3
Author:     Milan Zazrivec <mzazrivec>
AuthorDate: Thu Nov 26 11:46:21 2015 +0100
Commit:     Milan Zazrivec <mzazrivec>
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 15:55:28 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/636466c24964f844cb6fb375897e278d77b54db3

commit 636466c24964f844cb6fb375897e278d77b54db3
Author:     Milan Zazrivec <mzazrivec>
AuthorDate: Thu Nov 26 11:46:21 2015 +0100
Commit:     Milan Zazrivec <mzazrivec>
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 10:38:43 UTC
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 13:23:42 UTC
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 11:20:54 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/a647f6b8e4a62ef4113d9471fbef4c4fb06e1a9d

commit a647f6b8e4a62ef4113d9471fbef4c4fb06e1a9d
Author:     Milan Zazrivec <mzazrivec>
AuthorDate: Tue Apr 19 15:20:04 2016 +0200
Commit:     Milan Zazrivec <mzazrivec>
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 13:17:32 UTC
Verified in 5.6.0.4-beta2.3

Comment 14 errata-xmlrpc 2016-06-29 15:04:45 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.