| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: If1cb92ba0ff1a57ab8940d9f9e1fe66ffd34441a
|
|
|
|
|
|
| |
One code change, rest are in headers
Change-Id: I73f59681358629e1ad74e49d3d3ca13fcb5c2eb1
|
|
|
|
|
|
| |
Bug 1134802
Change-Id: I9cc3c9d9324314d293f01f047882eb6be06e02dd
|
|
|
|
|
|
|
|
|
| |
This is a follow-up to Doug suggestion at
https://review.openstack.org/#/c/20323/2/openstack/common/timeutils.py
Change-Id: Ic318202234202e56054df1b5cc7f82a404c307bc
Signed-off-by: Julien Danjou <julien@danjou.info>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Using the BaseTestCase across the tests in the tree lets us put in log
fixtures and consistently handle mox and stubout.
Part of blueprint grizzly-testtools.
Change-Id: Iba7eb2c63b0c514009b2c28e5930b27726a147b0
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On the path to testr migration, we need to replace the unittest base classes
with testtools.
Replace tearDown with addCleanup, addCleanup is more resilient than tearDown.
The fixtures library has excellent support for managing and cleaning
tempfiles. Use it.
Replace skip_ with testtools.skipTest
Part of blueprint grizzly-testtools.
Change-Id: I45e11bbb1ff9b31f3278d3b016737dcb7850cd98
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Taken from glance xattr.py module. This function converts timestamp
formated dates into a UTC Iso 8601 date. It is being required in
multiple places now (mostly on clients printing dates) in order to make
dates human readable.
Change-Id: I6f19325a4c2df241a0ef76bd256280a2930d9265
|
|/
|
|
|
|
|
|
|
|
| |
This is a function defined as will_expire_soon at least twice in
python-keystoneclient, and it's actually quite handy. There is a comment on
that code about moving to timeutils, and it actually sounds like a good idea
since I'm likely to use it in Ceilometer, so here it is.
Change-Id: Idf208ce9e7ce9048a38d98212b7f730c6b7c8288
Signed-off-by: Julien Danjou <julien@danjou.info>
|
|
|
|
|
|
|
| |
This patch makes is_older_than() and is_newer_than() accept
timestamps in string format, as returned from strtime().
Change-Id: I1dbf453cc08bd8aaeb4fee2491a1e8aa74f8bee3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tests for timeutils use some canned datetime values that include
timezones, and override the result of utcnow() with the same. This
is not correct because the real utcnow() returns naive datetime
objects, so tests that assume the contrary are incorrect.
This came about because I was unable to satisfy both the oslo unit
tests and the nova ones with the same code. That happened because
the oslo ones override utcnow() with an invalid result, and the
nova tests use the real one.
Change-Id: I683818f77ce0d3e3b2f07c0326d7a7196f3346c3
|
|
|
|
|
|
|
| |
Allows time deltas in seconds to be concisely calculated
for py26 and py27.
Change-Id: I8987af1f892fda0a72f5eb0d45f94c595792dc78
|
|
|
|
|
|
|
|
|
|
| |
Added is_newer_than function to compare if the provided
time is newer than current time for specified number of
seconds
Fixes bug 1036343
Change-Id: Ic133b0e7e2337b6b0fdad244ded6a93f8db48379
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the timeutils.normalize_time() returns naive datetime
object when parameter timestamp is an naive object or a non-UTC
aware datetime object, and returns aware datetime object if
parameter timestamp is a UTC aware datetime object.
The basic problem here is that utcoffset() of None means the object is naive
but a utcoffset() of zero means that the object is aware but represents
UTC time.
This is fragile implementation and will trigger potential issue, because
aware/native datetime is not interoperatable. For example,
"timeutils.utcnow() > timeutils.normalize_time(m)" will success at most
time, while trigger TypeError if m is a UTC aware object.
We want to normalize all objects into naive objects.
Fixes bug 1048636
Change-Id: I4a09246fa8f0dd63ca54362b877aa825d9b79772
Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
|
|
|
|
|
|
| |
Needed for performance measurement via "inflight" service.
Change-Id: I5c1a8395b4cbc5fc0f8649b3af8130f45dd401bb
|
|
|
|
|
|
|
|
|
|
|
| |
This patch updates jsonutils.to_primitive() to use timeutils.strtime()
to convert a datimetime object to a string instead of just using str().
This ensures that we can easily convert the string back to a datetime
using timeutils.parse_strtime().
Required for the nova blueprint no-db-messaging.
Change-Id: I725b333695930e12e2832378102514326fec639c
|
|
|
|
|
|
|
|
| |
Fixes bug #1011121
Use calendar.timegm instead of time.mktime
Change-Id: Idb8d470f1ef90162641d21122699a026fa38faf1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes bug #1009410
1. Add the following functions from nova/utils.py
- strtime
- parse_strtime
- is_older_than
- utcnow_ts
- advance_time_delta
- advance_time_seconds
2. Write unittests in tests/unit/test_timeutils.py
Change-Id: Ie0bba90833e2ed31bb5ab867a7c1a76a9901cacb
|
|
Split time related utility functions out of openstack.common.utils into
a new module, timeutils.
Change-Id: Ic09952cd48e0b4548e410926cc456cbd515a4e56
|