Bug 817123 - deleted system template not removed from activation key
deleted system template not removed from activation key
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: Unspecified
: --
Assigned To: Mike McCune
Kedar Bidarkar
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2012-04-27 14:39 EDT by Tom McKay
Modified: 2013-03-27 16:17 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Activation keys referenced in deleted system templates caused the template to remain in the system_template table and the activation_keys table. This prevents the deletion of the template due to a dependency issue. This update uses a deletion changeset, which deletes system templates from environments and also deletes the association to the activation key.
Story Points: ---
Clone Of:
Last Closed: 2012-12-04 14:44:59 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tom McKay 2012-04-27 14:39:15 EDT
Create and promote a system template. Now create an activation key that references that system template. Finally, delete the system template.

Expected: The system template would also be removed from the activation key.
Actual: Template is still listed in UI on act key page.

Database diving still shows the system template in system_templates table, as well as association to it in activation_keys table.
Comment 2 Lukas Zapletal 2012-05-02 08:49:37 EDT
What you want is cascade deletion. Is this really what we want to do? I mean, activation keys can be distributed across companies/users and template removal could lead to deletion of activation key without letting know to the user.

Another solution could be error message requesting user to remove all activation key references first, which seems to be more appropriate for me.

Mike - opinion about this?
Comment 3 Mike McCune 2012-05-02 11:12:52 EDT
We should be cascading the deletes on the association tables but not on the primary objects themselves.  Sounds like we need a dependent => destroy in the model for these objects
Comment 4 Mike McCune 2012-05-11 10:43:35 EDT
After a bit more discussion Lukáš pointed out that it may be fine to delete from the Library but we can't mass delete templates from all the promoted environments without a changeset.

This needs to be taken care of in our Content Deletion story we are going to implement in 1.1
Comment 5 Lukas Zapletal 2012-05-29 03:11:29 EDT
Removing 1.0.z flag as this is going to be part of new feature. Mike if you still want to deliver temporary workaround, put it back.
Comment 6 Mike McCune 2012-08-03 13:11:11 EDT
This is addressed in Content Deletion which is part of 1.1.  Will validate this scenario during testing/dev
Comment 7 Mike McCune 2012-08-27 14:19:29 EDT
now with a Deletion changeset you can go in and delete System Templates from environments which deletes the association to the Activation Key.  I tested this and it worked fine.
Comment 9 Kedar Bidarkar 2012-09-21 03:17:06 EDT
Below are the steps followed for verification.

1) Created and Promoted a template to Dev env
2) Created an activation key ( act_193_keys) and added the Dev_template to it.
3) Attached is the screenshot with the above state 'act_keys_dev_template.png'
4) Created a Deletion changeset, for the Dev env to delete the Dev_template and promoted it.
5) The Association of the template is removed from the activation key act_193_keys.
6) Attached is the screenshot with the template association removed. 'act_keys_No_template.png'

Comment 12 Kedar Bidarkar 2012-09-21 03:20:07 EDT
small correction: comment11 should be read as 

"Act_keys with the template from Dev env removed via deletion changeset"
Comment 14 errata-xmlrpc 2012-12-04 14:44:59 EST
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.


Note You need to log in before you can comment on or make changes to this bug.