Bug #24269
closedCan not delete host if there are SCAP reports for that host
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1402513
Description of problem:
If a host has any SCAP reports and you try to delete said host from the Hosts -> All Hosts view or by click on the host and select the delete option then you get the following error message:
error: PG::Error: ERROR: update or delete on table "hosts" violates foreign key constraint "reports_host_id_fk" on table "reports" DETAIL: Key (id)=(43) is still referenced from table "reports". : DELETE FROM "hosts" WHERE "hosts"."type" IN ('Host::Managed') AND "hosts"."id" = $1
Version-Release number of selected component (if applicable):
6.2.4
How reproducible:
Always if a host has any SCAP reports.
Steps to Reproduce:
1. attempt to delete a host that has any SCAP reports
Actual results:
Host deletion fails with cryptic message
Expected results:
The host and the SCAP reports get deleted without error. OR, an option pops up to also delete the SCAP reports or preserve them even after host has been deleted.