diff options
| author | Russell Bryant <rbryant@redhat.com> | 2012-07-18 16:15:52 -0400 |
|---|---|---|
| committer | Russell Bryant <rbryant@redhat.com> | 2012-07-18 16:15:52 -0400 |
| commit | 2d6f84742a3e8ea51ebbfb82cbeacefe97e199d5 (patch) | |
| tree | f35bda4f63f632f622d1c620d9ab6246aa22eeaa /openstack/common/plugin/pluginmanager.py | |
| parent | 1c1b36985be5a4c49b9cfc808edcdfd288c6d0cc (diff) | |
| download | oslo-2d6f84742a3e8ea51ebbfb82cbeacefe97e199d5.tar.gz oslo-2d6f84742a3e8ea51ebbfb82cbeacefe97e199d5.tar.xz oslo-2d6f84742a3e8ea51ebbfb82cbeacefe97e199d5.zip | |
Track to_primitive() depth after iteritems().
Change jsonutils.to_primitive() to increase the recursion depth counter
when calling to_primitive() on the result of iteritems() from the
current element. Previously, the only time the counter was increased
was when converting the __dict__ from an object. The iteritems() case
risks cycles, as well.
I hit a problem with this when trying to call to_primitive on an
instance of nova.db.sqlalchemy.models.Instance. An Instance includes a
reference to InstanceInfoCache, which has a reference back to the
Instance. Without this change, to_primitive() would raise an exception
for an Instance due to excessive recursion.
Related to nova blueprint no-db-messaging.
Change-Id: Ifb878368d97e92ab6c361a4dd5f5ab2e68fc16e2
Diffstat (limited to 'openstack/common/plugin/pluginmanager.py')
0 files changed, 0 insertions, 0 deletions
