Use list literals (#33659)

This commit is contained in:
springstan 2020-04-04 23:14:47 +02:00 committed by GitHub
parent dde93304d3
commit db72039b8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 18 additions and 18 deletions

View file

@ -107,12 +107,12 @@ class BanLogParser:
def __init__(self, log_file):
"""Initialize the parser."""
self.log_file = log_file
self.data = list()
self.data = []
self.ip_regex = {}
def read_log(self, jail):
"""Read the fail2ban log and find entries for jail."""
self.data = list()
self.data = []
try:
with open(self.log_file, encoding="utf-8") as file_data:
self.data = self.ip_regex[jail].findall(file_data.read())