<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 05/07/2014 03:47 PM, Petr Vobornik
wrote:<br>
</div>
<blockquote cite="mid:536A3985.20502@redhat.com" type="cite">krbpasswordexpiration
conversion to number of second since epoch failed
<br>
because now we get datetime object instead of string.
<br>
<br>
<a class="moz-txt-link-freetext" href="https://fedorahosted.org/freeipa/ticket/4339">https://fedorahosted.org/freeipa/ticket/4339</a>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Freeipa-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Freeipa-devel@redhat.com">Freeipa-devel@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/freeipa-devel">https://www.redhat.com/mailman/listinfo/freeipa-devel</a></pre>
</blockquote>
<br>
NACK, I don't think this is the right approach. This does not
leverage the simplicity which the DateTime parameter refactoring
provides.<br>
<br>
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?<br>
<br>
Then you could simplify this:<br>
<br>
+ exp = time.mktime(expiration.timetuple())<br>
+ if exp <= time.time():<br>
<br>
to this:<br>
<br>
+ if expiration <= datetime.datetime.now()<br>
<br>
<pre class="moz-signature" cols="72">--
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org </pre>
</body>
</html>