- Added TAI64N support

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@227 a942ae1a-1317-0410-a47c-b1dcaea8d605
0.6
Cyril Jaquier 2006-01-03 15:13:04 +00:00
parent be26cd5b75
commit fb07353aeb
1 changed files with 7 additions and 1 deletions

View File

@ -202,7 +202,13 @@ class LogReader:
value.
"""
try:
date = list(time.strptime(value, self.timepattern))
# Check if the parsed value is in TAI64N format
if not self.timepattern.lower() == "tai64n":
date = list(time.strptime(value, self.timepattern))
else:
# extract part of format which represents seconds since epoch
seconds_since_epoch = value[2:17]
date = list(time.gmtime(int(seconds_since_epoch, 16)))
except ValueError, e:
logSys.error(e)
logSys.error("Please check the format and your locale settings.")