mirror of https://github.com/MISP/misp-modules
chg: [pep8] try/except # noqa
Not sure how to make flake happy on this one.pull/299/head
parent
9af06fd24c
commit
559ed786ba
|
@ -72,7 +72,6 @@ def handler(q=False):
|
||||||
return misperrors
|
return misperrors
|
||||||
|
|
||||||
if sample_id > 0:
|
if sample_id > 0:
|
||||||
e = None
|
|
||||||
try:
|
try:
|
||||||
api = VMRayRESTAPI(request["config"].get("url"), request["config"].get("apikey"), False)
|
api = VMRayRESTAPI(request["config"].get("url"), request["config"].get("apikey"), False)
|
||||||
vmray_results = {'results': []}
|
vmray_results = {'results': []}
|
||||||
|
@ -130,7 +129,7 @@ def handler(q=False):
|
||||||
else:
|
else:
|
||||||
misperrors['error'] = "Unable to fetch sample id %u" % (sample_id)
|
misperrors['error'] = "Unable to fetch sample id %u" % (sample_id)
|
||||||
return misperrors
|
return misperrors
|
||||||
except Exception as e:
|
except Exception as e: # noqa
|
||||||
misperrors['error'] = "Unable to access VMRay API : %s" % (e)
|
misperrors['error'] = "Unable to access VMRay API : %s" % (e)
|
||||||
return misperrors
|
return misperrors
|
||||||
else:
|
else:
|
||||||
|
@ -174,7 +173,7 @@ def vmrayDownloadAnalysis(api, analysis_id):
|
||||||
try:
|
try:
|
||||||
data = api.call("GET", "/rest/analysis/%u/archive/logs/summary.json" % (analysis_id), raw_data=True)
|
data = api.call("GET", "/rest/analysis/%u/archive/logs/summary.json" % (analysis_id), raw_data=True)
|
||||||
return json.loads(data.read().decode())
|
return json.loads(data.read().decode())
|
||||||
except Exception as e:
|
except Exception as e: # noqa
|
||||||
misperrors['error'] = "Unable to download summary.json for analysis %s" % (analysis_id)
|
misperrors['error'] = "Unable to download summary.json for analysis %s" % (analysis_id)
|
||||||
return misperrors
|
return misperrors
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue