fix: New expected type

pull/10/head
Raphaël Vinot 2020-04-07 14:30:55 +02:00
parent 9da5da57c4
commit 1f450da171
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class PyMISPWarningListsError(Exception):
class WarningList():
expected_types = ['string', 'substring', 'hostname', 'cidr']
expected_types = ['string', 'substring', 'hostname', 'cidr', 'regex']
def __init__(self, warninglist, slow_search=False):
self.warninglist = warninglist
@ -41,7 +41,7 @@ class WarningList():
self.version = int(self.warninglist['version'])
self.name = self.warninglist['name']
if self.warninglist['type'] not in self.expected_types:
raise PyMISPWarningListsError('Unexpected type, please update the expected_type list')
raise PyMISPWarningListsError(f'Unexpected type ({self.warninglist["type"]}), please update the expected_type list')
self.type = self.warninglist['type']
if self.warninglist.get('matching_attributes'):
self.matching_attributes = self.warninglist['matching_attributes']