Listen to flake8, it speaks the truth

Use a variable name that doesn't conflict with a library name.
This commit is contained in:
James Laska 2015-06-16 08:55:59 -04:00
parent 3522920b08
commit 390011bb1e

View File

@ -271,21 +271,21 @@ class ApiV1ConfigView(APIView):
return Response(None, status=status.HTTP_404_NOT_FOUND)
# Remove license file
errno = None
has_error = None
for fname in (TEMPORARY_TASK_FILE, TASK_FILE):
try:
os.remove(fname)
except OSError, e:
if e.errno != errno.ENOENT:
errno = e.errno
has_error = e.errno
break
# Only stop mongod if license removal succeeded
if errno is None:
if has_error is None:
mongodb_control.delay('stop')
return Response(status=status.HTTP_204_NO_CONTENT)
else:
return Response({"error": "Failed to remove license (%s)" % errno}, status=status.HTTP_400_BAD_REQUEST)
return Response({"error": "Failed to remove license (%s)" % has_error}, status=status.HTTP_400_BAD_REQUEST)
class DashboardView(APIView):