From f7b228ac563c4ac54adc7b2b8f6721d4f41653e0 Mon Sep 17 00:00:00 2001 From: Hannah Ward Date: Mon, 21 Nov 2016 11:57:49 +0000 Subject: [PATCH] Use misp_stix_converter.converters.convert's load_stix method --- pymisp/tools/stix.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pymisp/tools/stix.py b/pymisp/tools/stix.py index fe9ca2a..b6463c8 100644 --- a/pymisp/tools/stix.py +++ b/pymisp/tools/stix.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- try: - from misp_stix_converter.converters.buildMISPAttribute import buildEvent, open_stix + from misp_stix_converter.converters.buildMISPAttribute import buildEvent + from misp_stix_converter.converters import convert from misp_stix_converter.converters.convert import MISPtoSTIX has_misp_stix_converter = True except ImportError: @@ -13,7 +14,7 @@ def load_stix(stix, distribution=3, threat_level_id=2, analysis=0): '''Returns a MISPEvent object from a STIX package''' if not has_misp_stix_converter: raise Exception('You need to install misp_stix_converter: pip install git+https://github.com/MISP/MISP-STIX-Converter.git') - stix = open_stix(stix) + stix = convert.load_stix(stix) return buildEvent(stix, distribution=distribution, threat_level_id=threat_level_id, analysis=analysis)