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