From e737605c1b835b943cba60865272f54dc494a2ae Mon Sep 17 00:00:00 2001 From: David Cruciani Date: Mon, 26 Feb 2024 15:24:34 +0100 Subject: [PATCH] fix: [website] misp-objects submodule --- .gitmodules | 3 --- website/app/utils/utils.py | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0eb2560..e9f78ac 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,6 +2,3 @@ path = misp_modules/lib/misp-objects url = https://github.com/MISP/misp-objects.git branch = main -[submodule "website/data/misp-objects"] - path = website/data/misp-objects - url = https://github.com/MISP/misp-objects diff --git a/website/app/utils/utils.py b/website/app/utils/utils.py index e8be259..4da65c7 100644 --- a/website/app/utils/utils.py +++ b/website/app/utils/utils.py @@ -4,6 +4,7 @@ import json import requests # import jsonschema from config import Config +from pathlib import Path MODULES = [] @@ -39,7 +40,9 @@ def isUUID(uid): return False def get_object(obj_name): - loc_path = os.path.join(os.getcwd(), "data", "misp-objects", "objects") + path = Path(os.getcwd()) + parent_path = path.parent.absolute() + loc_path = os.path.join(parent_path, "misp_modules", "lib", "misp-objects", "objects") if os.path.isdir(loc_path): with open(os.path.join(loc_path, obj_name, "definition.json"), "r") as read_json: loc_json = json.load(read_json)