6 Commits

Author SHA1 Message Date
Sean McGinnis
9c4aefb8ea Handle TZ change in iso8601 >=0.1.12
The iso8601 lib introduced a change such that if running on python
3.2 or later it internally uses the python timezone information
instead of its own implementation. This does not change direct
date handling, but when converting this value there is a slight
difference where now python 2.x will show UTC times as "UTC", but
on python 3 they will end up with "UTC+00:00".

The to_primitive call for DateTime fields was doing an exact match
on "UTC" to determine whether to include "Z" in the resulting string.
This updates that handling to recognize either of the new values.

Change-Id: I71b58e8fd8fee8a57ee275ff3e0b77f165eca836
Closes-bug: #1744160
2018-01-24 03:00:51 +00:00
Kevin Benton
020dd5d1d2 Fix incorrect timestamp comment
Comment implied that the util would return a timestamp with
microseconds when it actually truncates microseconds.

Change-Id: I8a0645a0a781208f457cf4877f716a5778d27d42
2016-09-05 03:57:44 -07:00
ChangBo Guo(gcb)
a9752e281a Use version convert methods from oslo_utils.versionutils
oslo_utils provide version convert methods in versionutis[1],
these methods work well on Python 2.7 and Python 3.4,
so don't need maintain them.

[1]https://github.com/openstack/oslo.utils/blob/master/oslo_utils/versionutils.py

Change-Id: Ifc4b7f5c7e42bce9f5bbf8a961fd32506cca98eb
2015-12-01 00:26:55 +08:00
Davanum Srinivas (dims)
19d21f65e2 Switch back to iso format on the wire
following change id replaced timeutils.isotime(dt) with dt.isoformat():
Ied2643d3d891600e0e5cd31c7ef1ff6107e3a777

However this change breaks existing contract between Nova components
on the wire, so we need to resurrect a bit of the older code.

Change-Id: I151e889258a33fe6ce961b514c3967f521a218cf
2015-08-18 12:38:51 +00:00
Joshua Harlow
e182ba6e54 Replace 'hypervisor' with 'provided' version
A hypervisor version is a nova concept and likely
doesn't belong in this library so tweak the wording
used.

Change-Id: Ia03d94334201e0229a339984ca0838911d4ee20d
2015-07-13 16:19:58 -07:00
Grzegorz Grasza
0d4bd24ed3 Rename utils -> _utils
Hide the utils module, which should not be part of the public API.
utils.py contains functions required internally (moved from Nova).

Change-Id: I3666d35d28592bd49768424049142e5d353a916d
Closes-Bug: 1417284
2015-02-16 11:19:31 +01:00