cinderlib/cinderlib
Gorka Eguileor 51609b61a4 Fix datetime serialization
Cinderlib's methods and property that convert objects to json end up
losing resolution on DateTime fields.

Since json doesn't have a datetime fields they are stored as strings,
but they are not storing subsecond information.

This means that datetime fields that are serialized and then
deserialized are different.

This patch changes the way we format the string to use the ISO-8601
subsecond format instead of the standard second format.

This is a backward compatible change, as this version of cinderlib will
be able to read old datetime string, and old cinderlib code will be able
to read new datetime strings as well (even if it cannot generate them).

The old code is able to read the new format because the from_primitive
code of the OVO field uses oslo_utils.timeutils.parse_isotime which in
the end uses iso8601.parse_date, and since the subsecond format is also
ISO8601 it is properly parsed.

Change-Id: I1422e833ec0ec50376d4afac91f22c7b60bf996b
Closes-Bug: #1933964
2021-06-29 17:48:07 +02:00
..
cmd Add DevStack plugin 2019-03-20 18:34:16 +01:00
persistence Remove reliance on embedded imports 2021-04-20 11:38:20 +01:00
tests Fix datetime serialization 2021-06-29 17:48:07 +02:00
__init__.py Add privsep support 2021-06-18 15:12:24 +02:00
_fake_packages.py Stop to use the __future__ module. 2020-06-02 20:08:16 +02:00
cinderlib.py Add privsep support 2021-06-18 15:12:24 +02:00
exception.py Remove unused exception 2019-02-04 17:06:58 +01:00
objects.py Add privsep support 2021-06-18 15:12:24 +02:00
serialization.py Fix datetime serialization 2021-06-29 17:48:07 +02:00
utils.py Fix Volume snapshots and connections on deletion 2019-03-13 15:04:50 +01:00
workarounds.py Update cinderlib 2019-01-14 16:25:18 +01:00