mirror of https://github.com/MISP/PyMISP
Fix typo in variable name.
parent
0c86d489b6
commit
622a5701ee
|
@ -101,7 +101,7 @@ class PyMISP(object):
|
||||||
warnings.warn("You turned on Async, but don't have requests_futures installed")
|
warnings.warn("You turned on Async, but don't have requests_futures installed")
|
||||||
self.asynch = False
|
self.asynch = False
|
||||||
|
|
||||||
self.ressources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
|
self.resources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
|
||||||
if out_type != 'json':
|
if out_type != 'json':
|
||||||
raise PyMISPError('The only output type supported by PyMISP is JSON. If you still rely on XML, use PyMISP v2.4.49')
|
raise PyMISPError('The only output type supported by PyMISP is JSON. If you still rely on XML, use PyMISP v2.4.49')
|
||||||
if debug is not None:
|
if debug is not None:
|
||||||
|
@ -136,7 +136,7 @@ class PyMISP(object):
|
||||||
if not self.describe_types.get('sane_defaults'):
|
if not self.describe_types.get('sane_defaults'):
|
||||||
raise PyMISPError('The MISP server your are trying to reach is outdated (<2.4.52). Please use PyMISP v2.4.51.1 (pip install -I PyMISP==v2.4.51.1) and/or contact your administrator.')
|
raise PyMISPError('The MISP server your are trying to reach is outdated (<2.4.52). Please use PyMISP v2.4.51.1 (pip install -I PyMISP==v2.4.51.1) and/or contact your administrator.')
|
||||||
except Exception:
|
except Exception:
|
||||||
with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f:
|
with open(os.path.join(self.resources_path, 'describeTypes.json'), 'r') as f:
|
||||||
describe_types = json.load(f)
|
describe_types = json.load(f)
|
||||||
self.describe_types = describe_types['result']
|
self.describe_types = describe_types['result']
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ class MISPAttribute(object):
|
||||||
|
|
||||||
def __init__(self, describe_types=None):
|
def __init__(self, describe_types=None):
|
||||||
if not describe_types:
|
if not describe_types:
|
||||||
self.ressources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
|
self.resources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
|
||||||
with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f:
|
with open(os.path.join(self.resources_path, 'describeTypes.json'), 'r') as f:
|
||||||
t = json.load(f)
|
t = json.load(f)
|
||||||
describe_types = t['result']
|
describe_types = t['result']
|
||||||
self.describe_types = describe_types
|
self.describe_types = describe_types
|
||||||
|
@ -289,15 +289,15 @@ def _int_to_str(d):
|
||||||
class MISPEvent(object):
|
class MISPEvent(object):
|
||||||
|
|
||||||
def __init__(self, describe_types=None, strict_validation=False):
|
def __init__(self, describe_types=None, strict_validation=False):
|
||||||
self.ressources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
|
self.resources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
|
||||||
if strict_validation:
|
if strict_validation:
|
||||||
with open(os.path.join(self.ressources_path, 'schema.json'), 'r') as f:
|
with open(os.path.join(self.resources_path, 'schema.json'), 'r') as f:
|
||||||
self.json_schema = json.load(f)
|
self.json_schema = json.load(f)
|
||||||
else:
|
else:
|
||||||
with open(os.path.join(self.ressources_path, 'schema-lax.json'), 'r') as f:
|
with open(os.path.join(self.resources_path, 'schema-lax.json'), 'r') as f:
|
||||||
self.json_schema = json.load(f)
|
self.json_schema = json.load(f)
|
||||||
if not describe_types:
|
if not describe_types:
|
||||||
with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f:
|
with open(os.path.join(self.resources_path, 'describeTypes.json'), 'r') as f:
|
||||||
t = json.load(f)
|
t = json.load(f)
|
||||||
describe_types = t['result']
|
describe_types = t['result']
|
||||||
self.describe_types = describe_types
|
self.describe_types = describe_types
|
||||||
|
|
|
@ -25,8 +25,8 @@ class TestOffline(unittest.TestCase):
|
||||||
self.event = {'Event': json.load(f)}
|
self.event = {'Event': json.load(f)}
|
||||||
with open('tests/new_misp_event.json', 'r') as f:
|
with open('tests/new_misp_event.json', 'r') as f:
|
||||||
self.new_misp_event = {'Event': json.load(f)}
|
self.new_misp_event = {'Event': json.load(f)}
|
||||||
self.ressources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '../pymisp/data')
|
self.resources_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '../pymisp/data')
|
||||||
with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f:
|
with open(os.path.join(self.resources_path, 'describeTypes.json'), 'r') as f:
|
||||||
self.types = json.load(f)
|
self.types = json.load(f)
|
||||||
with open('tests/sharing_groups.json', 'r') as f:
|
with open('tests/sharing_groups.json', 'r') as f:
|
||||||
self.sharing_groups = json.load(f)
|
self.sharing_groups = json.load(f)
|
||||||
|
|
Loading…
Reference in New Issue