Bug 1072336

Summary: Move setting the system's default release action to the database layer.
Product: [Retired] Beaker Reporter: Raymond Mancy <rmancy>
Component: generalAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.15CC: aigao, asaha, dcallagh, ebaak, jzhao, rmancy, tools-bugs
Target Milestone: 19.0Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-25 07:18:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1014438    
Bug Blocks:    

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.