Red Hat Bugzilla – Bug 817123
deleted system template not removed from activation key
Last modified: 2013-03-27 16:17:50 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.
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?
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
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
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.
This is addressed in Content Deletion which is part of 1.1. Will validate this scenario during testing/dev
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.
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' .
small correction: comment11 should be read as "Act_keys with the template from Dev env removed via deletion changeset"
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. http://rhn.redhat.com/errata/RHSA-2012-1543.html