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

Simo Sorce simo at redhat.com
Tue Jun 4 19:57:25 UTC 2013


On Tue, 2013-06-04 at 19:50 +0000, John Wood wrote:
> 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
> 

You should always use UTC dates in barbican, using/allowing timezones is
only going to hit you back, badly.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York




More information about the OpenStack-dev mailing list