[Openstack] [ceilometer] ceilometer parse UTC timestamp unreasonably

Julien Danjou julien at danjou.info
Tue Jan 7 10:17:46 UTC 2014


On Tue, Jan 07 2014, 刘胜 wrote:

> hi all:I have report a
> bug:https://bugs.launchpad.net/ceilometer/+bug/1266398When using “ceilometer
> statistics -m instance -q "start=2011114-01-03T01:45:49" ” The ceilometer
> parse a invalid UTC timestamp with no error.I have analysed the code about
> "statistics",the ceilometer use iso8601 python lib to parse the UTC
> time.But, the method iso8601.parse_date() parse "2011114-01-03T01:45:49" to
> "2011-11-04 00:00:00+00:00" . So, this problem occoured.While, I have tested
> the method with two lines of codes:import iso8601print
> iso8601.parse_date(u"201114-01-03T01:45:49")It resulted
> error:"iso8601.iso8601.ParseError: month must be in 1..12"But, after I
> modified the year in timestamp,like this:import iso8601print
> iso8601.parse_date(u"20114-01-03T01:45:49")the result is:"2011-04-01
> 00:00:00+00:00"
>
> So, it is a bug of iso8601 python lib?if it is,how to fix the bug?

It sounds like it. Open at least an issue on
https://bitbucket.org/micktwomey/pyiso8601/issues and if you have a pull
request, let me know and I'll review it.

-- 
Julien Danjou
/* Free Software hacker * independent consultant
   http://julien.danjou.info */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20140107/9734893c/attachment.sig>


More information about the Openstack mailing list