fix None handling in filters

master
Yves G 2018-01-31 13:05:42 +01:00
parent 50075efcfb
commit 07ae8164cd
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
# pyruse is intended as a replacement to both fail2ban and epylog # pyruse is intended as a replacement to both fail2ban and epylog
# Copyright © 2017 Y. Gablin # Copyright © 20172018 Y. Gablin
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing. # Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
from pyruse import base from pyruse import base
@ -10,4 +10,4 @@ class Filter(base.Filter):
self.value = args["value"] self.value = args["value"]
def filter(self, entry): def filter(self, entry):
return entry.get(self.field, None) == self.value return entry[self.field] == self.value if self.field in entry else False

View File

@ -1,5 +1,5 @@
# pyruse is intended as a replacement to both fail2ban and epylog # pyruse is intended as a replacement to both fail2ban and epylog
# Copyright © 2017 Y. Gablin # Copyright © 20172018 Y. Gablin
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing. # Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
from pyruse import base from pyruse import base
@ -10,4 +10,4 @@ class Filter(base.Filter):
self.value = args["value"] self.value = args["value"]
def filter(self, entry): def filter(self, entry):
return entry.get(self.field, None) >= self.value return entry[self.field] >= self.value if self.field in entry else False