[Freeipa-devel] [PATCH] 630 rpcserver: login_password datetime fix in expiration check

Petr Vobornik pvoborni at redhat.com
Wed May 7 14:26:41 UTC 2014


On 7.5.2014 16:01, Tomas Babej wrote:
>
> On 05/07/2014 03:47 PM, Petr Vobornik wrote:
>> krbpasswordexpiration conversion to number of second since epoch failed
>> because now we get datetime object instead of string.
>>
>> https://fedorahosted.org/freeipa/ticket/4339
>>
>>
> NACK, I don't think this is the right approach. This does not leverage
> the simplicity which the DateTime parameter refactoring provides.
>
> Instead of converting the datetime to the number of the seconds since
> epoch, and getting the current time represented by the number of seconds
> since the epoch (using time.time()), why not use datetime module and
> datetime.datetime.now() to get the current time?
>
> Then you could simplify this:
>
> +                        exp = time.mktime(expiration.timetuple())
> +                        if exp <= time.time():
>
> to this:
>
> +                        if expiration <= datetime.datetime.now()
>

Good point, fixed

-- 
Petr Vobornik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0630-1-rpcserver-login_password-datetime-fix-in-expiration-.patch
Type: text/x-patch
Size: 1550 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140507/17540061/attachment.bin>


More information about the Freeipa-devel mailing list