From 1f450da1712b60ed5c1a581531e3a86e3a1eb3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 7 Apr 2020 14:30:55 +0200 Subject: [PATCH] fix: New expected type --- pymispwarninglists/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymispwarninglists/api.py b/pymispwarninglists/api.py index 47ff252..737b508 100644 --- a/pymispwarninglists/api.py +++ b/pymispwarninglists/api.py @@ -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']