fix: [website] misp-objects submodule

pull/659/head
David Cruciani 2024-02-26 15:24:34 +01:00
parent a2721c967b
commit e737605c1b
No known key found for this signature in database
GPG Key ID: 8690CDE1E3994B9B
2 changed files with 4 additions and 4 deletions

3
.gitmodules vendored
View File

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

View File

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