Feature #3664

Support deletion of installation media that's in use

Added by Dominic Cleal over 4 years ago. Updated 7 days ago.

Status:Closed
Priority:Normal
Assignee:Joseph Magen
Category:Database
Target version:1.6.0
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link: Found in Releases:
Pull request:https://github.com/theforeman/foreman/pull/1575

Description

When deleting a installation media that's associated to a host or host group, the deletion fails.

Actual results:
Error, installation medium is not deleted.

Expected results:
Hosts and Host Groups are un-associated to the install media and the install media is deleted.

Additional info:

Current work around is to unassociate that install media from any host or host groups in foreman and re-try the promotion.

Error in foreman:

Started DELETE "/foreman/api/media/14" for 127.0.0.1 at 2013-11-08 16:54:00 -0500
Processing by Api::V1::MediaController#destroy as JSON
Parameters: {"id"=>"14", "medium"=>{}}
Authorized user admin(Admin User)
You may not destroy Mosaic/Development/Desktop Fedora Fedora 19 x86_64 as it is in use!
Unprocessable entity Medium (id: 14):
Mosaic/Development/Desktop Fedora Fedora 19 x86_64 is used by Desktop
Rendered api/v1/errors/unprocessable_entity.json.rabl (1.4ms)
Completed 422 Unprocessable Entity in 54ms (Views: 2.6ms | ActiveRecord: 34.7ms)

(https://bugzilla.redhat.com/show_bug.cgi?id=1030584)


Related issues

Related to Foreman - Feature #6401: change include blank option to "No environments" or "No s... New 06/26/2014

Associated revisions

Revision 08d248fc
Added by Joseph Magen about 4 years ago

fixes #3664 - support deletion of installation media that's in use

History

#1 Updated by Dominic Cleal over 4 years ago

We need to consider the user experience thoroughly without just changing the association to nullify. For example, the host edit page doesn't have an allow_blank on the install media selection, so it appears that the install media is actually selected when it isn't.

Perhaps we should block deletion when there are associated hosts in build mode?

Perhaps we should ensure the user gets a good error message when they put a host into build mode that's missing install media? (I haven't checked)

#2 Updated by Joseph Magen about 4 years ago

  • Status changed from New to Assigned
  • Assignee set to Joseph Magen
  • Target version set to 1.8.1

#3 Updated by Joseph Magen about 4 years ago

  • Related to Feature #6401: change include blank option to "No environments" or "No subnets", etc if there are no select options, or "Select environment", "Select subnet" if for required field and options > 1 added

#4 Updated by Joseph Magen about 4 years ago

The media field on the host form does allow for a blank option, we can do :nullify if the host is not in build mode.

Is this still a bug now that Katello (I think) doesn't create a media entry?

#5 Updated by Dominic Cleal about 4 years ago

Joseph Magen wrote:

The media field on the host form does allow for a blank option, we can do :nullify if the host is not in build mode.

Editing hosts one by one isn't very practical.

Is this still a bug now that Katello (I think) doesn't create a media entry?

Plenty of people use Foreman without Katello.

#6 Updated by Dmitri Dolguikh about 4 years ago

  • Target version changed from 1.8.1 to 1.8.0

#7 Updated by Dominic Cleal about 4 years ago

  • Status changed from Assigned to Ready For Testing

#8 Updated by The Foreman Bot about 4 years ago

  • Pull request https://github.com/theforeman/foreman/pull/1575 added

#9 Updated by Joseph Magen about 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#10 Updated by Dominic Cleal almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 10

Also available in: Atom PDF