Merge branch 'master' of github.com:CIRCL/PyMISP

pull/30/head
Raphaël Vinot 2016-11-24 10:42:46 +01:00
commit e1b5000a16
1 changed files with 3 additions and 2 deletions

View File

@ -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)