From f5452055f607fcdba8e407a78fa106ff172c1155 Mon Sep 17 00:00:00 2001 From: chrisr3d Date: Fri, 10 Jan 2020 10:31:52 +0100 Subject: [PATCH] fix: Fixed vt_graph imports --- misp_modules/lib/__init__.py | 2 ++ misp_modules/lib/vt_graph_parser/__init__.py | 8 ++------ misp_modules/lib/vt_graph_parser/helpers/__init__.py | 3 +++ misp_modules/lib/vt_graph_parser/helpers/parsers.py | 2 +- misp_modules/lib/vt_graph_parser/importers/__init__.py | 7 +------ misp_modules/lib/vt_graph_parser/importers/base.py | 2 +- .../lib/vt_graph_parser/importers/pymisp_response.py | 4 ++-- misp_modules/modules/export_mod/vt_graph.py | 2 +- 8 files changed, 13 insertions(+), 17 deletions(-) diff --git a/misp_modules/lib/__init__.py b/misp_modules/lib/__init__.py index 57a25055..c078cf7f 100644 --- a/misp_modules/lib/__init__.py +++ b/misp_modules/lib/__init__.py @@ -1 +1,3 @@ +from .vt_graph_parser import * # noqa + all = ['joe_parser', 'lastline_api'] diff --git a/misp_modules/lib/vt_graph_parser/__init__.py b/misp_modules/lib/vt_graph_parser/__init__.py index 2a4d3390..abc02c57 100644 --- a/misp_modules/lib/vt_graph_parser/__init__.py +++ b/misp_modules/lib/vt_graph_parser/__init__.py @@ -4,9 +4,5 @@ This module provides methods to import graph from misp. """ -from lib.vt_graph_parser.importers import from_pymisp_response - - -__all__ = [ - "from_pymisp_response" -] +from .helpers import * # noqa +from .importers import * # noqa diff --git a/misp_modules/lib/vt_graph_parser/helpers/__init__.py b/misp_modules/lib/vt_graph_parser/helpers/__init__.py index 336faeea..7e0ec861 100644 --- a/misp_modules/lib/vt_graph_parser/helpers/__init__.py +++ b/misp_modules/lib/vt_graph_parser/helpers/__init__.py @@ -2,3 +2,6 @@ This modules provides functions and attributes to help MISP importers. """ + + +all = ["parsers", "rules", "wrappers"] diff --git a/misp_modules/lib/vt_graph_parser/helpers/parsers.py b/misp_modules/lib/vt_graph_parser/helpers/parsers.py index c621595e..8ca57458 100644 --- a/misp_modules/lib/vt_graph_parser/helpers/parsers.py +++ b/misp_modules/lib/vt_graph_parser/helpers/parsers.py @@ -4,7 +4,7 @@ This module provides parsers for MISP inputs. """ -from lib.vt_graph_parser.helpers.wrappers import MispAttribute +from vt_graph_parser.helpers.wrappers import MispAttribute MISP_INPUT_ATTR = [ diff --git a/misp_modules/lib/vt_graph_parser/importers/__init__.py b/misp_modules/lib/vt_graph_parser/importers/__init__.py index 129d8709..c59197c6 100644 --- a/misp_modules/lib/vt_graph_parser/importers/__init__.py +++ b/misp_modules/lib/vt_graph_parser/importers/__init__.py @@ -4,9 +4,4 @@ This module provides methods to import graphs from MISP. """ -from lib.vt_graph_parser.importers.pymisp_response import from_pymisp_response - - -__all__ = [ - "from_pymisp_response" -] +__all__ = ["base", "pymisp_response"] diff --git a/misp_modules/lib/vt_graph_parser/importers/base.py b/misp_modules/lib/vt_graph_parser/importers/base.py index 4d9b855c..ed5c0fc3 100644 --- a/misp_modules/lib/vt_graph_parser/importers/base.py +++ b/misp_modules/lib/vt_graph_parser/importers/base.py @@ -5,7 +5,7 @@ This module provides a common method to import graph from misp attributes. import vt_graph_api -from lib.vt_graph_parser.helpers.rules import MispEventInitialRule +from vt_graph_parser.helpers.rules import MispEventInitialRule def import_misp_graph( diff --git a/misp_modules/lib/vt_graph_parser/importers/pymisp_response.py b/misp_modules/lib/vt_graph_parser/importers/pymisp_response.py index 86a3b258..e0e834b2 100644 --- a/misp_modules/lib/vt_graph_parser/importers/pymisp_response.py +++ b/misp_modules/lib/vt_graph_parser/importers/pymisp_response.py @@ -5,8 +5,8 @@ response payload giving by MISP API directly. """ -from lib.vt_graph_parser.helpers.parsers import parse_pymisp_response -from lib.vt_graph_parser.importers.base import import_misp_graph +from vt_graph_parser.helpers.parsers import parse_pymisp_response +from vt_graph_parser.importers.base import import_misp_graph def from_pymisp_response( diff --git a/misp_modules/modules/export_mod/vt_graph.py b/misp_modules/modules/export_mod/vt_graph.py index d8b3359d..70c1952c 100644 --- a/misp_modules/modules/export_mod/vt_graph.py +++ b/misp_modules/modules/export_mod/vt_graph.py @@ -3,7 +3,7 @@ import base64 import json -from lib.vt_graph_parser import from_pymisp_response +from vt_graph_parser.importers.pymisp_response import from_pymisp_response misperrors = {