consistency with the configuration file

This commit is contained in:
Jerome Leonard 2017-05-22 21:56:10 +02:00
parent 3fad29ef63
commit 1ecc251178

View File

@ -21,7 +21,7 @@ class FireholBlocklistsAnalyzer(Analyzer):
# Get config parameters # Get config parameters
self.path = self.getParam('config.blocklistpath', '/tmp/fireholblocklists') self.path = self.getParam('config.blocklistpath', '/tmp/fireholblocklists')
self.ignoredays = self.getParam('config.ignoreolderthandays', 365) self.ignoredays = self.getParam('config.ignoredays', 365)
self.utc = pytz.UTC self.utc = pytz.UTC
self.now = dt.datetime.now(tz=self.utc) self.now = dt.datetime.now(tz=self.utc)
@ -73,6 +73,7 @@ class FireholBlocklistsAnalyzer(Analyzer):
datestr = re.sub('# Source File Date: ', '', l.rstrip('\n')) datestr = re.sub('# Source File Date: ', '', l.rstrip('\n'))
date = parse(datestr) date = parse(datestr)
file_date[ipsetname] = str(date) file_date[ipsetname] = str(date)
print(self.now - date).days
if (self.now - date).days > self.ignoredays: if (self.now - date).days > self.ignoredays:
break break
description[ipsetname] += re.sub(r'^\[.*\] \(.*\) [a-zA-Z0-9.\- ]*$', '', l.lstrip('# '))\ description[ipsetname] += re.sub(r'^\[.*\] \(.*\) [a-zA-Z0-9.\- ]*$', '', l.lstrip('# '))\