Bug 1497746

Summary: Editing Name of a Category via API breaks Chargeback Assignments
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: ReportingAssignee: Gregg Tanzillo <gtanzill>
Status: CLOSED ERRATA QA Contact: Nandini Chandra <nachandr>
Severity: urgent Docs Contact:
Priority: medium    
Version: 5.7.0CC: cpelland, gtanzill, jhardy, myoder, obarenbo, smallamp
Target Milestone: GAKeywords: ZStream
Target Release: 5.8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: chargeback
Fixed In Version: 5.8.2.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1483365 Environment:
Last Closed: 2017-10-24 00:41:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On: 1483365    
Bug Blocks:    

Comment 2 CFME Bot 2017-10-02 15:01:17 UTC
New commit detected on ManageIQ/manageiq/fine:
https://github.com/ManageIQ/manageiq/commit/6b8f0a802346f37c89143114135d0fce1440189f

commit 6b8f0a802346f37c89143114135d0fce1440189f
Author:     Joe Rafaniello <jrafanie.github.com>
AuthorDate: Fri Sep 29 14:00:32 2017 -0400
Commit:     Satoe Imaishi <simaishi>
CommitDate: Mon Oct 2 10:57:51 2017 -0400

    Merge pull request #16039 from gtanzillo/delete-tag-assignments
    
    Delete tag assignments when deleting a tag that is referenced in an assignment
    (cherry picked from commit fc67deb5c3a1eca38574e9001ec52f933da0b112)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1497746

 app/models/classification.rb                | 16 +++++++--
 app/models/mixins/assignment_mixin.rb       | 11 +++++-
 spec/models/classification_spec.rb          | 56 +++++++++++++++++++++++++----
 spec/models/mixins/assignment_mixin_spec.rb | 18 ++++++++++
 4 files changed, 91 insertions(+), 10 deletions(-)

Comment 3 Nandini Chandra 2017-10-06 21:25:26 UTC
Before fix:

1)Create a custom category, cat1.Add a tag, tag1 for the category.
2)Assign tag1 to a VM
3)Chargeback assignments , make these selections: 
  Assign to:    Tagged VMs and instances
  Tag Category: cat1
  Selections Name: cat1; rate: Default
4)Delete tag1 
5)Unable to edit chargeback assignments and error message in logs:


After fix

1)Create a custom category, cat1.Add a tag, tag1 for the category.
2)Assign tag1 to a VM
3)Chargeback assignments , make these selections: 
  Assign to:    Tagged VMs and instances
  Tag Category: cat1
  Selections Name: cat1; rate: Default
4)Delete tag1
5)No errors in logs  and it should be possible to edit chargeback assignments

Comment 4 Nandini Chandra 2017-10-06 21:25:58 UTC
Verified in 5.8.2.2

Comment 6 errata-xmlrpc 2017-10-24 00:41:44 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/RHSA-2017:3005