Bug 1022461 - 500 error when remove some Power Type
500 error when remove some Power Type
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: web UI (Show other bugs)
0.15
Unspecified Unspecified
unspecified Severity medium (vote)
: 22.0
: ---
Assigned To: Roman Joost
tools-bugs
: Patch
: 1199920 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-23 06:41 EDT by wangjing
Modified: 2018-02-05 19:41 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-14 00:34:06 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 3 Raymond Mancy 2013-10-23 20:33:36 EDT
Yes, I can't imagine it's ever OK to delete a power type when it is still being used. Obviously we need to handle this situation better than with an ISE.

This page is mostly useful for adding power types, as rarely would we want to delete power types I'm guessing. Maybe we don't even need this page.
Comment 4 Nick Coghlan 2013-10-24 20:59:23 EDT
As Ray notes, we should be reporting something like "cannot remove power type that is still in use" or equivalent. Alternatively, we may need to switch to the "hidden" rather than "deleted" approach to power types as well (since Removed systems may still reference an otherwise no longer needed power type)
Comment 5 Dan Callaghan 2015-03-09 20:42:21 EDT
*** Bug 1199920 has been marked as a duplicate of this bug. ***
Comment 6 David Galloway 2015-05-07 15:45:25 EDT
(In reply to Nick Coghlan from comment #4)
> As Ray notes, we should be reporting something like "cannot remove power
> type that is still in use" or equivalent. Alternatively, we may need to
> switch to the "hidden" rather than "deleted" approach to power types as well
> (since Removed systems may still reference an otherwise no longer needed
> power type)

+1 for the "hidden" vs "deleted" approach.  We're just trying to clean up the power type dropdown and I ran into this bug trying to delete a power type that is only used by Removed systems.

This bug is still present in Beaker v20.0.
Comment 7 Roman Joost 2015-08-27 02:26:50 EDT
I'll implement the "hidden" approach as stated by Nick. Dan mentioned in naming terms it would be good to track the deletion with a "delete" column.
Comment 8 Roman Joost 2015-08-27 20:31:47 EDT
After careful thinking we've come to the conclusion that setting the power type to just "deleted" is a bit pointless due to the fact that is just a 'label' with one column.

The plan is now:
(1) port all the existing TG grid stuff to a simple page with a list-group and Create and Delete buttons,
(2) return a nicer error message if the power type is already referenced,
(3) The deletion of a power type should create an entry in the activity log
(4) (optional) add some UI which pre-checks if a power type is referenced and gives the user a modal saying: "This power type is used by <x> systems, etc"
Comment 9 Roman Joost 2015-09-14 00:34:26 EDT
Sorry, forgot to add a link to the gerrit patch:

https://gerrit.beaker-project.org/#/c/4372/
Comment 10 Roman Joost 2015-09-14 00:39:59 EDT
(In reply to David Galloway from comment #6)
> (In reply to Nick Coghlan from comment #4)
> > As Ray notes, we should be reporting something like "cannot remove power
> > type that is still in use" or equivalent. Alternatively, we may need to
> > switch to the "hidden" rather than "deleted" approach to power types as well
> > (since Removed systems may still reference an otherwise no longer needed
> > power type)
> 
> +1 for the "hidden" vs "deleted" approach.  We're just trying to clean up
> the power type dropdown and I ran into this bug trying to delete a power
> type that is only used by Removed systems.
> 
> This bug is still present in Beaker v20.0.

Unfortunately this bug fix won't be a solution for this situation unfortunately. The command line tool doesn't provide a designated command as well. The current best work around we can off is searching for old systems which use the power type* and then manually clear their power settings.

* Using a command like: bkr system-list --xml-filter '<powertype value="something"/>'
Comment 13 Dan Callaghan 2016-01-14 00:34:06 EST
Beaker 22.0 has been released.

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