Bug 1072336 - Move setting the system's default release action to the database layer.
Summary: Move setting the system's default release action to the database layer.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: general
Version: 0.15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 19.0
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On: 1014438
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-04 12:08 UTC by Raymond Mancy
Modified: 2018-02-06 00:41 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-11-25 07:18:26 UTC
Embargoed:


Attachments (Terms of Use)

Description Raymond Mancy 2014-03-04 12:08:41 UTC
Description of problem:

We currently have a couple of different places in the code where we determine
what the default release action should be. 


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Unfortunately we can't set this default on the DB schema because sqlalchemy does not support the 'Enum' type in the 'default_server' kwarg. Setting the 'default' kwarg is the next best thing.

Comment 1 Raymond Mancy 2014-03-04 12:15:28 UTC
http://gerrit.beaker-project.org/#/c/2874/

Comment 3 Dan Callaghan 2014-03-04 22:57:33 UTC
(In reply to Raymond Mancy from comment #0)
> Unfortunately we can't set this default on the DB schema because sqlalchemy
> does not support the 'Enum' type in the 'default_server' kwarg. Setting the
> 'default' kwarg is the next best thing.

That seems surprising, it should treat an enum value like any other literal (it becomes a string literal on the database side).

Is this a documented issue? What error did you get?

Comment 4 Raymond Mancy 2014-03-05 00:15:04 UTC
(In reply to Dan Callaghan from comment #3)
> (In reply to Raymond Mancy from comment #0)
> > Unfortunately we can't set this default on the DB schema because sqlalchemy
> > does not support the 'Enum' type in the 'default_server' kwarg. Setting the
> > 'default' kwarg is the next best thing.
> 
> That seems surprising, it should treat an enum value like any other literal
> (it becomes a string literal on the database side).
> 
> Is this a documented issue? What error did you get?

So it won't let you pass in an Enum type. It doesn't convert it to a string literal itself.

However, you can actually pass it in as a string literal, so server_default=unicode(ReleaseAction.power_off) does work.

Comment 5 Raymond Mancy 2014-03-05 00:16:08 UTC
http://gerrit.beaker-project.org/#/c/2874

Comment 6 Raymond Mancy 2014-03-11 04:40:49 UTC
This has been merged onto the new-system-page branch

Comment 7 Dan Callaghan 2014-09-18 05:43:36 UTC
This was merged to develop as part of the new-system-page branch.

Comment 11 Dan Callaghan 2014-11-25 07:18:26 UTC
Beaker 19.0 has been released.


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