From: Stephen Gran Date: Sat, 9 May 2009 15:00:06 +0000 (+0100) Subject: Some cleanup in IsRetired() X-Git-Tag: userdir-ldap-0.3.67~14^2~2 X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;ds=sidebyside;h=33adb64b484784404b6d4ebb0d64d9ce87b79e8c;p=mirror%2Fuserdir-ldap.git Some cleanup in IsRetired() --- diff --git a/ud-generate b/ud-generate index 67a50f8..d8a7090 100755 --- a/ud-generate +++ b/ud-generate @@ -101,10 +101,11 @@ def IsRetired(DnRecord): # We'll give them a few extra days over what we said age = 6 * 31 * 24 * 60 * 60 try: - if (time.time() - time.mktime(time.strptime(line[1], "%Y-%m-%d"))) > age: - return True + return (time.time() - time.mktime(time.strptime(line[1], "%Y-%m-%d"))) > age except IndexError: return False + except ValueError: + return False return False