From 23bed216dbbd512e733ecf6065105b2d20703531 Mon Sep 17 00:00:00 2001 From: Brian Lamar Date: Mon, 28 Mar 2011 13:04:02 -0400 Subject: Added MUCH more flexiable iso8601 parser dep for added stability. --- nova/image/glance.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'nova/image') 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) -- cgit