mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 20:30:46 -03:30
Listen to flake8, it speaks the truth
Use a variable name that doesn't conflict with a library name.
This commit is contained in:
parent
3522920b08
commit
390011bb1e
@ -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):
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user