mirror of
https://github.com/ansible/awx.git
synced 2026-01-10 15:32:07 -03:30
Fix up flake8 runtime configuration, do a bit of flake8 work as it
relates to pyflakes)
This commit is contained in:
parent
6a77c5dbab
commit
888ae53027
3
Makefile
3
Makefile
@ -228,6 +228,9 @@ pep8:
|
||||
pyflakes:
|
||||
pyflakes awx/
|
||||
|
||||
check:
|
||||
flake8
|
||||
|
||||
# Run all API unit tests.
|
||||
test:
|
||||
$(PYTHON) manage.py test -v2 awx.main.tests
|
||||
|
||||
@ -12,7 +12,7 @@ __all__ = ['__version__']
|
||||
# Check for the presence/absence of "devonly" module to determine if running
|
||||
# from a source code checkout or release packaage.
|
||||
try:
|
||||
import awx.devonly
|
||||
import awx.devonly # noqa
|
||||
MODE = 'development'
|
||||
except ImportError: # pragma: no cover
|
||||
MODE = 'production'
|
||||
@ -57,7 +57,7 @@ def prepare_env():
|
||||
import six
|
||||
sys.modules['django.utils.six'] = sys.modules['six']
|
||||
django.utils.six = sys.modules['django.utils.six']
|
||||
from django.utils import six
|
||||
from django.utils import six # noqa
|
||||
# Use the AWX_TEST_DATABASE_* environment variables to specify the test
|
||||
# database settings to use when management command is run as an external
|
||||
# program via unit tests.
|
||||
|
||||
@ -4,18 +4,15 @@
|
||||
# Python
|
||||
import inspect
|
||||
import logging
|
||||
import json
|
||||
import time
|
||||
|
||||
# Django
|
||||
from django.http import Http404
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import connection
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.timezone import now
|
||||
|
||||
# Django REST Framework
|
||||
from rest_framework.authentication import get_authorization_header
|
||||
@ -27,8 +24,8 @@ from rest_framework import status
|
||||
from rest_framework import views
|
||||
|
||||
# AWX
|
||||
from awx.main.models import *
|
||||
from awx.main.utils import *
|
||||
from awx.main.models import * # noqa
|
||||
from awx.main.utils import * # noqa
|
||||
|
||||
__all__ = ['APIView', 'GenericAPIView', 'ListAPIView', 'SimpleListAPIView',
|
||||
'ListCreateAPIView', 'SubListAPIView', 'SubListCreateAPIView',
|
||||
|
||||
15
awx/urls.py
15
awx/urls.py
@ -1,20 +1,17 @@
|
||||
# Copyright (c) 2014 AnsibleWorks, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import *
|
||||
from django.conf.urls import url, patterns, include
|
||||
|
||||
handler403 = 'awx.main.views.handle_403'
|
||||
handler404 = 'awx.main.views.handle_404'
|
||||
handler500 = 'awx.main.views.handle_500'
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'', include('awx.ui.urls', namespace='ui', app_name='ui')),
|
||||
url(r'^api/', include('awx.api.urls', namespace='api', app_name='api')),
|
||||
)
|
||||
url(r'', include('awx.ui.urls', namespace='ui', app_name='ui')),
|
||||
url(r'^api/', include('awx.api.urls', namespace='api', app_name='api')))
|
||||
|
||||
urlpatterns += patterns('awx.main.views',
|
||||
url(r'^403.html$', 'handle_403'),
|
||||
url(r'^404.html$', 'handle_404'),
|
||||
url(r'^500.html$', 'handle_500'),
|
||||
)
|
||||
url(r'^403.html$', 'handle_403'),
|
||||
url(r'^404.html$', 'handle_404'),
|
||||
url(r'^500.html$', 'handle_500'))
|
||||
|
||||
@ -14,9 +14,7 @@ https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
|
||||
from awx import prepare_env
|
||||
prepare_env()
|
||||
|
||||
import os
|
||||
import logging
|
||||
from django.conf import settings
|
||||
from awx import __version__ as tower_version
|
||||
logger = logging.getLogger('awx.main.models.jobs')
|
||||
try:
|
||||
|
||||
@ -15,3 +15,7 @@
|
||||
# W293 - Blank line contains whitespace
|
||||
ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E302,E303,E501,W291,W391,W293
|
||||
exclude=awx/lib/site-packages,awx/ui,awx/api/urls.py,awx/main/migrations,awx/main/tests/data
|
||||
|
||||
[flake8]
|
||||
ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E302,E303,E501,W291,W391,W293
|
||||
exclude=awx/lib/site-packages,awx/ui,awx/api/urls.py,awx/main/migrations,awx/main/tests/data
|
||||
|
||||
46
setup.py
46
setup.py
@ -3,10 +3,12 @@
|
||||
# Copyright (c) 2014 AnsibleWorks, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
import os, datetime, glob, sys, shutil
|
||||
from distutils import log
|
||||
from setuptools import setup, find_packages
|
||||
from setuptools.command.sdist import sdist as _sdist
|
||||
import os
|
||||
import datetime
|
||||
import glob
|
||||
import sys
|
||||
import shutil
|
||||
from setuptools import setup
|
||||
|
||||
from awx import __version__
|
||||
|
||||
@ -113,26 +115,22 @@ setup(
|
||||
],
|
||||
},
|
||||
data_files = proc_data_files([
|
||||
("%s" % homedir, ["config/wsgi.py",
|
||||
"awx/static/favicon.ico",
|
||||
]),
|
||||
("%s" % webconfig, ["config/awx-httpd-80.conf",
|
||||
"config/awx-httpd-443.conf",
|
||||
"config/awx-munin.conf",
|
||||
]),
|
||||
("%s" % sharedir, ["tools/scripts/request_tower_configuration.sh",]),
|
||||
("%s" % munin_plugin_path, ["tools/munin_monitors/tower_jobs",
|
||||
"tools/munin_monitors/callbackr_alive",
|
||||
"tools/munin_monitors/celery_alive",
|
||||
"tools/munin_monitors/postgres_alive",
|
||||
"tools/munin_monitors/redis_alive",
|
||||
"tools/munin_monitors/socketio_alive",
|
||||
"tools/munin_monitors/taskmanager_alive"]),
|
||||
("%s" % munin_plugin_conf_path, ["config/awx_munin_tower_jobs"]),
|
||||
("%s" % sysinit, ["tools/scripts/ansible-tower"]),
|
||||
("%s" % sosconfig, ["tools/sosreport/tower.py"]),
|
||||
]
|
||||
),
|
||||
("%s" % homedir, ["config/wsgi.py",
|
||||
"awx/static/favicon.ico"]),
|
||||
("%s" % webconfig, ["config/awx-httpd-80.conf",
|
||||
"config/awx-httpd-443.conf",
|
||||
"config/awx-munin.conf"]),
|
||||
("%s" % sharedir, ["tools/scripts/request_tower_configuration.sh",]),
|
||||
("%s" % munin_plugin_path, ["tools/munin_monitors/tower_jobs",
|
||||
"tools/munin_monitors/callbackr_alive",
|
||||
"tools/munin_monitors/celery_alive",
|
||||
"tools/munin_monitors/postgres_alive",
|
||||
"tools/munin_monitors/redis_alive",
|
||||
"tools/munin_monitors/socketio_alive",
|
||||
"tools/munin_monitors/taskmanager_alive"]),
|
||||
("%s" % munin_plugin_conf_path, ["config/awx_munin_tower_jobs"]),
|
||||
("%s" % sysinit, ["tools/scripts/ansible-tower"]),
|
||||
("%s" % sosconfig, ["tools/sosreport/tower.py"])]),
|
||||
options = {
|
||||
'egg_info': {
|
||||
'tag_build': build_timestamp,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user