[Freeipa-devel] [PATCH 0137] ipalib: Add DateTime parameter

Nathaniel McCallum npmccallum at redhat.com
Wed May 7 15:46:16 UTC 2014


On Wed, 2014-05-07 at 09:50 -0400, Dmitri Pal wrote:
> On 05/07/2014 04:06 AM, Jan Cholasta wrote:
> > On 6.5.2014 19:55, Nathaniel McCallum wrote:
> >> I know it is a bit late on this, but for the OTP token import script, I
> >> have to have support for the full ISO 8601. My plan right now is to use
> >> python-dateutil for this.
> >>
> >> Using dateutil would simplify some of this code. Is there a reason we
> >> aren't using dateutil?
> >
> > IIRC it was rejected right at the beginning as an overkill.
> >
> 
> What are the alternatives?

Hand-coded date parsing, AFAICS. That is what we are currently doing. In
order to make this sane, we greatly restrict the date formats permitted
as input to a small subset of ISO 8601. This is possible because we just
tell the users to type the date in one of the supported formats.

Unfortunately, I can't make that trade-off in the token import script
since I have no control over the input. Since I have to support all of
ISO 8601 (including timezone conversions), the dateutils module is
pretty much the only option. If we adopt it for OTP import, we might as
well throw away our hand-coded date parsing.

Nathaniel





More information about the Freeipa-devel mailing list