[openstack-dev] [barbican] Date/time/timezone parsing

John Wood john.wood at RACKSPACE.COM
Tue Jun 4 19:50:11 UTC 2013


Hello folks,

We noticed that the 'timeutils.py' module's 'parse_isotime()' function in Oslo Incubator doesn't properly parse all ISO8601-compliant strings, or else raise parse errors for non compliant strings.  Has anyone else noticed this behavior?

This is a problem for Barbican as we need to precisely know when to expire a secret to avoid unpleasant surprises, but this 'off by a few hours' issue may not be a problem for other parts of OpenStack.

For example, if you try to pass a string of the form (no ':mm' after the final 'hh'):

YYYY-MM-DDThh:mm:ss±hh

...results in the timezone offset being ignored. Likewise for this form (single digit timezone):

YYYY-MM-DDThh:mm:ss±h:mm

...results in the timezone being ignored.

As a concrete example, the following failed to observe the timezone:

013-06-14T12:06:30.629256-5:00

whereas this following works:

013-06-14T12:06:30.629256-05:00

Thanks,
John


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130604/cf2ca02a/attachment.html>


More information about the OpenStack-dev mailing list