Bug #17129
closedUnable to delete content view or version that is associated with a hostgroup
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1388173
Description of problem:
Unable to delete a content view or version that is associated with a hostgroup
with a kickstart repository.
How reproducible:
Always
Steps to Reproduce:
1. Create a content view with kickstart repository.
2. Create a hostgroup associate it with CV and lifecycle environment.
3. Select operating system tab, Media selection to synced content and select media.
4. Change the CV and Media selection
5. Attempt to delete the content view version.
6. Unassociate the media from the hostgroup and then attempt to delete the content view version.
7. Attempt to delete the content view.
Actual results:
After step 5, observe the following:
ERROR: update or delete on table "katello_repositories" violates foreign key constraint "hostgroups_kickstart_repository_id_fk" on table "hostgroups" DETAIL: Key (id)=(25) is still referenced from table "hostgroups"
After step 7, observe the following from the Content view deletion task (Monitor -> Tasks)
Cannot delete record because of dependent hostgroups
Expected results:
Should be able to delete the content view and version