![]() 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 |
||
---|---|---|
.. | ||
db | ||
extensions | ||
network | ||
port | ||
qos | ||
__init__.py | ||
address_scope.py | ||
base.py | ||
common_types.py | ||
rbac_db.py | ||
securitygroup.py | ||
subnet.py | ||
subnetpool.py | ||
trunk.py | ||
utils.py |