← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1817633] [NEW] Listing placement usages causes a circular reference error

 

Public bug reported:

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.

** Affects: nova
     Importance: High
     Assignee: Chris Dent (cdent)
         Status: Triaged


** Tags: placement

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1817633

Title:
  Listing placement usages causes a circular reference error

Status in OpenStack Compute (nova):
  Triaged

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1817633/+subscriptions


Follow ups