Bug 841398 - lazy_create does not handle DeviceClass(device_class=None)
Summary: lazy_create does not handle DeviceClass(device_class=None)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 0.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Callaghan
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-18 21:16 UTC by Steven Lawrance
Modified: 2019-05-22 13:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-09 08:06:51 UTC
Embargoed:


Attachments (Terms of Use)

Description Steven Lawrance 2012-07-18 21:16:41 UTC
DeviceClass' constructor turns an argument of device_class=None into the string "NONE".  When lazy_create attempts to insert this, an IntegrityError is raised and it fails as it should...

However, the subsequent attempt to fetch the existing row fails because it is filtering on device_class=None rather than device_class="NONE".

This breaks the inventory script, which attempts to push several devices of type None.

One solution might be to give DeviceClass its own lazy_create to handle this special case, as was done for Distro.

Comment 1 Dan Callaghan 2012-07-27 07:25:26 UTC
On Gerrit: http://gerrit.beaker-project.org/1248

Comment 3 Dan Callaghan 2012-08-09 08:06:51 UTC
Beaker 0.9.2 has been released.


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