diff options
| author | Brian Lamar <brian.lamar@rackspace.com> | 2011-03-28 13:04:02 -0400 |
|---|---|---|
| committer | Brian Lamar <brian.lamar@rackspace.com> | 2011-03-28 13:04:02 -0400 |
| commit | 23bed216dbbd512e733ecf6065105b2d20703531 (patch) | |
| tree | 9f4f4ae7b259f64ea8108f07897bf3a7369dddf4 /nova/image | |
| parent | 4aad5721bff628ef8b34e0c536e0e2415f2b63f4 (diff) | |
Added MUCH more flexiable iso8601 parser dep for added stability.
Diffstat (limited to 'nova/image')
| -rw-r--r-- | nova/image/glance.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/nova/image/glance.py b/nova/image/glance.py index f0f1ecf57..c08e2e0e8 100644 --- a/nova/image/glance.py +++ b/nova/image/glance.py @@ -20,6 +20,8 @@ from __future__ import absolute_import import datetime +import iso8601 + from glance.common import exception as glance_exception from nova import exception @@ -230,8 +232,4 @@ def _parse_glance_iso8601_timestamp(timestamp): """ Parse a subset of iso8601 timestamps into datetime objects """ - GLANCE_FMT = "%Y-%m-%dT%H:%M:%S" - ISO_FMT = "%Y-%m-%dT%H:%M:%S.%f" - # FIXME(sirp): Glance is not returning in ISO format, we should fix Glance - # to do so, and then switch to parsing it here - return datetime.datetime.strptime(timestamp, GLANCE_FMT) + return iso8601.parse_date(timestamp).replace(tzinfo=None) |
