mirror of https://github.com/MISP/PyMISP
added misp object templates path argument
parent
85bc693a63
commit
716fd2723c
|
@ -814,9 +814,12 @@ class MISPObject(AbstractMISP):
|
||||||
super(MISPObject, self).__init__(**kwargs)
|
super(MISPObject, self).__init__(**kwargs)
|
||||||
self.__strict = strict
|
self.__strict = strict
|
||||||
self.name = name
|
self.name = name
|
||||||
self.__misp_objects_path = os.path.join(
|
if kwargs.get('misp_objects_path', None):
|
||||||
os.path.abspath(os.path.dirname(sys.modules['pymisp'].__file__)),
|
self.__misp_objects_path = kwargs.get('misp_objects_path', None)
|
||||||
'data', 'misp-objects', 'objects')
|
else:
|
||||||
|
self.__misp_objects_path = os.path.join(
|
||||||
|
os.path.abspath(os.path.dirname(sys.modules['pymisp'].__file__)),
|
||||||
|
'data', 'misp-objects', 'objects')
|
||||||
if os.path.exists(os.path.join(self.__misp_objects_path, self.name, 'definition.json')):
|
if os.path.exists(os.path.join(self.__misp_objects_path, self.name, 'definition.json')):
|
||||||
self.__known_template = True
|
self.__known_template = True
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue