small code review

pull/1459/head
sebres 2016-06-10 11:22:14 +02:00
parent d344274271
commit e40a8c8ae8
1 changed files with 8 additions and 12 deletions

View File

@ -533,21 +533,17 @@ class Filter(JailThread):
# failure-id: # failure-id:
fid = fail.get('fid') fid = fail.get('fid')
# ip-address or host: # ip-address or host:
host = fail.get('ip4') host = fail.get('ip4') or fail.get('ip6')
if host is not None: if host is not None:
raw = True raw = True
else: else:
host = fail.get('ip6') host = fail.get('dns')
if host is not None: if host is None:
raw = True # if no failure-id also (obscure case, wrong regex), throw error inside getFailID:
else: if fid is None:
host = fail.get('dns') fid = failRegex.getFailID()
if host is None: host = fid
# if no failure-id also (obscure case, wrong regex), throw error inside getFailID: cidr = IPAddr.CIDR_RAW
if fid is None:
fid = failRegex.getFailID()
host = fid
cidr = IPAddr.CIDR_RAW
# if raw - add single ip or failure-id, # if raw - add single ip or failure-id,
# otherwise expand host to multiple ips using dns (or ignore it if not valid): # otherwise expand host to multiple ips using dns (or ignore it if not valid):
if raw: if raw: