Bug 1744514

Summary: [RFE] automate method to delete a tag from a category
Product: Red Hat CloudForms Management Engine Reporter: Gellert Kis <gekis>
Component: AutomateAssignee: Jay Zeng <zhzeng>
Status: CLOSED NOTABUG QA Contact: Ganesh Hubale <ghubale>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.9CC: dmetzger, ghubale, gmccullo, lavenel, mkanoor, obarenbo, phoffmann, simaishi, smallamp, zhzeng
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.12.0Flags: mfeifer: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1767901 (view as bug list) Environment:
Last Closed: 2020-03-20 15:42:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Feature
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1767901    

Comment 4 Tina Fitzgerald 2019-08-23 10:32:31 UTC
Hi Loic,

I'm concerned about exposing tag_delete to Automate. 
Deleting tags could cause issues for objects already using that tag value.

Thoughts?

Thanks,
Tina

Comment 5 Loic Avenel 2019-08-23 11:03:31 UTC
(In reply to Tina Fitzgerald from comment #4)
> Hi Loic,
> 
> I'm concerned about exposing tag_delete to Automate. 
> Deleting tags could cause issues for objects already using that tag value.
> 
> Thoughts?
> 
> Thanks,
> Tina

Agreed, we will then report an error is Tags are still in use...

Comment 6 Greg McCullough 2019-09-03 17:13:35 UTC
Jay, the existing logic to create tags is here: https://github.com/ManageIQ/manageiq-automation_engine/blob/master/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_methods.rb#L90

I suggest we also offer a `category_delete` to match the create and follow the same behavior that you can only delete the category if it no longer contains tags.

Comment 7 dmetzger 2019-09-23 18:54:35 UTC
What is the PR(s) associated with this BZ?

Comment 8 Jay Zeng 2019-09-23 19:05:13 UTC
(In reply to dmetzger from comment #7)
> What is the PR(s) associated with this BZ?

Please check the following two PRs:
https://github.com/ManageIQ/manageiq-automation_engine/pull/358
https://github.com/ManageIQ/manageiq-automation_engine/pull/363