Bug 841398 - lazy_create does not handle DeviceClass(device_class=None)
lazy_create does not handle DeviceClass(device_class=None)
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: scheduler (Show other bugs)
0.9
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 0.9.2
: ---
Assigned To: Dan Callaghan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-18 17:16 EDT by Steven Lawrance
Modified: 2012-08-09 04:06 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-09 04:06:51 EDT
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)
Description Steven Lawrance 2012-07-18 17:16:41 EDT
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 03:25:26 EDT
On Gerrit: http://gerrit.beaker-project.org/1248
Comment 3 Dan Callaghan 2012-08-09 04:06:51 EDT
Beaker 0.9.2 has been released.

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