neutron/neutron/objects
Kevin Benton 3756bc5105 Convert OVO fields to primitives for to_dict()
to_dict() is used for conversions of OVO objects into
regular dictionaries to be used as plugin return values
to the API layer, etc. It provides the equivalent of
make_<resource>_dict that we use now (without the extension
processing). The values in these dictionaries should be
ready for representation in the API.

The issue was that the OVO to_dict() implementation was
placing complex types right into the dictionary which
would mean that the API would serialize them just by
calling str() on them (as part of json encoding). This
ignored the 'to_primitive' method defined on the OVO
type that defines how a field should be converted.
Therefore, when it came to timestamps to_dict() was
placing native datetime objects into the dictionary
which would convert to microsecond resolution, violating
the expected format of the OVO DateTime type.

This patch fixes the issue by calling 'to_primitive'
on each non-synthetic field in the to_dict() method
to ensure we match the expected format of the type before
we send it out the API.

Closes-Bug: #1620254
Change-Id: Ic0be54b1d4b23119e1458d4532e2f70bff0ff9f6
2016-09-07 03:50:27 -07:00
..
db objects: introduce count() API to count matching objects 2016-08-03 16:59:50 +02:00
extensions Merge "objects: introduce NetworkPortSecurity object" 2016-07-22 22:19:46 +00:00
network Add name and desc to networksegments table 2016-09-01 09:41:09 -06:00
port models: move AllowedAddressPair model under neutron/db/models 2016-08-12 12:27:06 +00:00
qos Add standard attributes to qospolicy 2016-08-28 06:27:39 +00:00
__init__.py First QoS versioned objects, ever 2015-07-02 09:21:45 +03:00
address_scope.py Relocate AddressScope DB model 2016-08-17 14:43:44 -07:00
base.py Convert OVO fields to primitives for to_dict() 2016-09-07 03:50:27 -07:00
common_types.py Fix deprecation warnings 2016-08-26 22:16:06 -04:00
rbac_db.py objects: Add RBAC to Subnet OVO 2016-07-14 09:26:11 +02:00
securitygroup.py objects: add support for per parent type foreign keys 2016-08-23 18:58:03 +02:00
subnet.py objects: add support for per parent type foreign keys 2016-08-23 18:58:03 +02:00
subnetpool.py objects: Convert filters to string for list values. 2016-07-15 15:35:16 +02:00
trunk.py Implement state management for trunks 2016-08-30 13:12:55 -07:00
utils.py objects: introduce a util function to handle tenant_id filter 2016-08-03 08:42:38 +00:00