Listing placement usages causes a circular reference error

Bug #1817633 reported by Chris Dent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Chris Dent

Bug Description

With the removal of oslo versioned objects from from the Usage and UsageList classes, serializing usages can result in a ValueError: Circular reference detected because there is a decimal.Decimal in the data to be returned.

This is a result of a func.sum used in the query to get lists of aggregates.

Note that the creation of a Decimal does not happen with sqlite, so the problem is not revealed by the functional gabbi tests. It happened to show up in the pending gabbi-based integration tests https://review.openstack.org/#/c/601614/ . See: http://logs.openstack.org/08/607508/14/check/placement-gabbi-tempest/f7c3eca/controller/logs/screen-placement-api.txt.gz#_Feb_25_22_37_31_423135 for an example.

This can be fixed by casting the 'used' value to an int when creating a Usage.

Tags: placement
Revision history for this message
Chris Dent (cdent) wrote :
Changed in nova:
status: Triaged → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/placement 1.0.0.0rc1

This issue was fixed in the openstack/placement 1.0.0.0rc1 release candidate.

Changed in nova:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.