Only handle types "allow", "ignore" & "tcp"

This commit is contained in:
Pierre Gordon 2019-04-19 13:43:12 -05:00
parent 1b3f86e709
commit bcbf76a628
1 changed files with 1 additions and 3 deletions

View File

@ -25,10 +25,8 @@ class HostMatcher:
host = "%s:%s" % address
if self.handle in ["ignore", "tcp"]:
return any(rex.search(host) for rex in self.regexes)
elif self.handle == "allow":
else: # self.handle == "allow"
return any(not rex.search(host) for rex in self.regexes)
else:
return False
def __bool__(self):
return bool(self.patterns)