mirror of https://github.com/MISP/misp-modules
fix: Fixed unnecessary dictionary field call
- No longer necessary to go under 'Event' field since PyMISP does not contain it since the latest updatepull/326/head
parent
5bf35041cc
commit
0b603fc5d3
|
@ -405,7 +405,7 @@ class JoeParser():
|
|||
def finalize_results(self):
|
||||
if self.references:
|
||||
self.build_references()
|
||||
event = json.loads(self.misp_event.to_json())['Event']
|
||||
event = json.loads(self.misp_event.to_json())
|
||||
self.results = {key: event[key] for key in ('Attribute', 'Object', 'Tag') if (key in event and event[key])}
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -31,7 +31,7 @@ class VulnerabilityParser():
|
|||
def get_result(self):
|
||||
if self.references:
|
||||
self.__build_references()
|
||||
event = json.loads(self.misp_event.to_json())['Event']
|
||||
event = json.loads(self.misp_event.to_json())
|
||||
results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
|
||||
return {'results': results}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class URLhaus():
|
|||
return vt_object
|
||||
|
||||
def get_result(self):
|
||||
event = json.loads(self.misp_event.to_json())['Event']
|
||||
event = json.loads(self.misp_event.to_json())
|
||||
results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
|
||||
return {'results': results}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class VirusTotalParser(object):
|
|||
return self.input_types_mapping[self.attribute.type](self.attribute.value, recurse=True)
|
||||
|
||||
def get_result(self):
|
||||
event = json.loads(self.misp_event.to_json())['Event']
|
||||
event = json.loads(self.misp_event.to_json())
|
||||
results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
|
||||
return {'results': results}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class VirusTotalParser():
|
|||
self.apikey = apikey
|
||||
|
||||
def get_result(self):
|
||||
event = json.loads(self.misp_event.to_json())['Event']
|
||||
event = json.loads(self.misp_event.to_json())
|
||||
results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
|
||||
return {'results': results}
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ class CsvParser():
|
|||
return list2pop, misp, list(reversed(head))
|
||||
|
||||
def finalize_results(self):
|
||||
event = json.loads(self.misp_event.to_json())['Event']
|
||||
event = json.loads(self.misp_event.to_json())
|
||||
self.results = {key: event[key] for key in ('Attribute', 'Object') if (key in event and event[key])}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue