Skip to content

Commit

Permalink
use PyMISP, ExpandedPyMISP is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
rvyhnal authored and sebix committed Dec 8, 2024
1 parent a486071 commit 292ff74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions intelmq/bots/collectors/misp/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
from intelmq.lib.exceptions import MissingDependencyError

try:
try:
from pymisp import ExpandedPyMISP as PyMISP
except ImportError:
from pymisp import PyMISP
from pymisp import PyMISP
except ImportError:
PyMISP = None
import_fail_reason = 'import'
Expand Down
12 changes: 6 additions & 6 deletions intelmq/bots/experts/misp/expert.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from intelmq.lib.exceptions import MissingDependencyError

try:
from pymisp import ExpandedPyMISP
from pymisp import PyMISP
except ImportError:
ExpandedPyMISP = None
PyMISP = None


class MISPExpertBot(ExpertBot):
Expand All @@ -28,13 +28,13 @@ class MISPExpertBot(ExpertBot):
misp_url: str = "<insert url of MISP server (with trailing '/')>"

def init(self):
if ExpandedPyMISP is None:
if PyMISP is None:
raise MissingDependencyError('pymisp', '>=2.4.117.3')

# Initialize MISP connection
self.misp = ExpandedPyMISP(self.misp_url,
self.misp_key,
self.http_verify_cert)
self.misp = PyMISP(self.misp_url,
self.misp_key,
self.http_verify_cert)

def process(self):
event = self.receive_message()
Expand Down

0 comments on commit 292ff74

Please sign in to comment.