chg: [pep8] try/except # noqa

Not sure how to make flake happy on this one.
pull/299/head
Steve Clement 2019-05-02 11:44:32 +09:00 committed by GitHub
parent 9af06fd24c
commit 559ed786ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -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: