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

Petr Vobornik pvoborni at redhat.com
Mon May 26 11:11:44 UTC 2014


On 22.5.2014 10:37, Tomas Babej wrote:
>
> On 05/07/2014 04:37 PM, Petr Vobornik wrote:
>> On 7.5.2014 16:30, Tomas Babej wrote:
>>>
>>> On 05/07/2014 04:26 PM, Petr Vobornik wrote:
>>>> 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
>>>>
>>>
>>> Can you also please remove the (now) unused import for module time?
>>>
>> done
>>
>
> ACK.
>

Pushed to master: 1e96475a77280bbdc883c66e0dc451ef0559c5fb

-- 
Petr Vobornik




More information about the Freeipa-devel mailing list