fix: [stix export] Added all the needed paths to load the required python libraries

pull/7815/head
chrisr3d 2021-10-07 11:47:43 +02:00
parent 9a86b2c35a
commit 3a1fbf7023
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
3 changed files with 20 additions and 5 deletions

View File

@ -22,10 +22,15 @@ import json
import sys
import traceback
from pathlib import Path
from stix.core import STIXPackage
from typing import Union
sys.path.append(str(Path(__file__).resolve().parent / 'misp-stix'))
_current_path = Path(__file__).resolve().parent
sys.path.insert(0, str(_current_path.parents[2] / 'cti-python-stix2'))
sys.path.insert(1, str(_current_path / 'python-stix'))
sys.path.insert(2, str(_current_path / 'python-cybox'))
sys.path.insert(3, str(_current_path / 'mixbox'))
sys.path.insert(4, str(_current_path / 'misp-stix'))
from stix.core import STIXPackage
from misp_stix_converter import MISPtoSTIX1EventsParser, _get_json_events, _get_xml_events

View File

@ -5,7 +5,12 @@ import json
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).resolve().parent / 'misp-stix'))
_current_path = Path(__file__).resolve().parent
sys.path.insert(0, str(_current_path.parents[2] / 'cti-python-stix2'))
sys.path.insert(1, str(_current_path / 'python-stix'))
sys.path.insert(2, str(_current_path / 'python-cybox'))
sys.path.insert(3, str(_current_path / 'mixbox'))
sys.path.insert(4, str(_current_path / 'misp-stix'))
from misp_stix_converter import stix1_framing, stix20_framing, stix21_framing

View File

@ -22,10 +22,15 @@ import json
import sys
import traceback
from pathlib import Path
from stix2.base import STIXJSONEncoder
from typing import Union
sys.path.append(str(Path(__file__).resolve().parent.parent / 'misp-stix'))
_scripts_path = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(_scripts_path.parents[2] / 'cti-python-stix2'))
sys.path.insert(1, str(_scripts_path / 'python-stix'))
sys.path.insert(2, str(_scripts_path / 'python-cybox'))
sys.path.insert(3, str(_scripts_path / 'mixbox'))
sys.path.insert(4, str(_scripts_path / 'misp-stix'))
from stix2.base import STIXJSONEncoder
from misp_stix_converter import MISPtoSTIX20Parser, MISPtoSTIX21Parser