mirror of https://github.com/MISP/misp-modules
Use the write var on return
parent
e4c1468968
commit
c8b410161a
|
@ -51,15 +51,13 @@ def handler(q=False):
|
||||||
if not checks['success']:
|
if not checks['success']:
|
||||||
return misperrors
|
return misperrors
|
||||||
|
|
||||||
output = {'results': list()}
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bs = Backscatter(checks['config']['api_key'])
|
bs = Backscatter(checks['config']['api_key'])
|
||||||
response = bs.get_observations(query=output['value'], query_type='ip')
|
response = bs.get_observations(query=output['value'], query_type='ip')
|
||||||
if not response['success']:
|
if not response['success']:
|
||||||
misperrors['error'] = '%s: %s' % (response['error'], response['message'])
|
misperrors['error'] = '%s: %s' % (response['error'], response['message'])
|
||||||
return misperrors
|
return misperrors
|
||||||
r = {'results': [{'types': mispattributes['output'], 'values': [str(response)]}]}
|
output = {'results': [{'types': mispattributes['output'], 'values': [str(response)]}]}
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
misperrors['error'] = str(e)
|
misperrors['error'] = str(e)
|
||||||
return misperrors
|
return misperrors
|
||||||
|
|
Loading…
Reference in New Issue