Bug 1335572

Summary: Conditions in Policy profile are not removed immediately after deletion
Product: Red Hat CloudForms Management Engine Reporter: Dmitry Misharov <dmisharo>
Component: UI - OPSAssignee: Harpreet Kataria <hkataria>
Status: CLOSED ERRATA QA Contact: Dmitry Misharov <dmisharo>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.6.0CC: dmisharo, hkataria, jhardy, mpovolny, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: All   
OS: All   
Whiteboard: ui:control
Fixed In Version: 5.6.0.8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-29 15:59:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Condition details screens
none
Policy details none

Description Dmitry Misharov 2016-05-12 14:27:23 UTC
Description of problem:
Conditions in Policy profile are not removed immediately after deletion, page refresh is required.

Version-Release number of selected component (if applicable):
5.6.0.6-beta2.5.20160511140943_ff75fb2

How reproducible:
Always

Steps to Reproduce:
1. Navigate to Control->Explorer.
2. Create a test policy.
3. Create a test policy profile.
4. Assign the test policy to the test policy profile.
5. Create a test conditions.
6. Delete the test condition.

Actual results:
The test condition is still presented in the UI, but it's deleted from the db. After page refreshing the condition will be removed.

Expected results:
The condition should be removed immediately after deletion.

Comment 3 Harpreet Kataria 2016-05-13 21:08:26 UTC
Dmitry,

Above mentioned steps are not very clear to me. If I assign a condition to a policy or a policy Profile and then try to delete the Condition from Conditions accordion, Delete button is disabled as the Condition is in use at that point. See attached screenshots for conditions assignment and condition details screen with Delete button disabled.

Can you please provide exact recipe or an appliance when i can recreate the issue, that will be great.

Thanks,
~Harpreet

Comment 4 Harpreet Kataria 2016-05-13 21:09:36 UTC
Created attachment 1157358 [details]
Condition details screens

Comment 5 Harpreet Kataria 2016-05-13 21:10:13 UTC
Created attachment 1157359 [details]
Policy details

Comment 6 Harpreet Kataria 2016-05-13 21:15:18 UTC
Dmitry, 

please ignore my comment #3 i was able to recreate the issue, Had to Create a condition using "Create a new condition assigned to this Policy" button from Policy Profiles accordion, and then try to delete the condition from same location.

~Harpreet

Comment 7 Harpreet Kataria 2016-05-16 13:23:26 UTC
https://github.com/ManageIQ/manageiq/pull/8728

Comment 8 CFME Bot 2016-05-17 14:00:50 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/c747cc8afbc408c86b3a2fc6f93aaa5877a61575

commit c747cc8afbc408c86b3a2fc6f93aaa5877a61575
Author:     Harpreet Kataria <hkataria>
AuthorDate: Mon May 16 09:21:25 2016 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Mon May 16 09:21:25 2016 -0400

    Fixed a typo introduced during localization changes.
    
    - Added spec test to verify removal of condition from Policy.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1335572

 app/controllers/miq_policy_controller/conditions.rb   |  4 ++--
 .../miq_policy_controller/conditions_spec.rb          | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 spec/controllers/miq_policy_controller/conditions_spec.rb

Comment 9 Dmitry Misharov 2016-05-26 07:02:11 UTC
Verified fixed in 5.6.0.8-rc1.20160524155303_f2a5a50.

Comment 11 errata-xmlrpc 2016-06-29 15:59:52 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