mirror of
https://github.com/ansible/awx.git
synced 2026-09-05 03:18:29 -02:30
Additional flake8 cleanup
The flake8 command was identifying several warnings and errors. This change addresses the flake8 warnings and updates the setup.cfg with additional exclusions. If accepted, jenkins will be updated to use the flake8 command, rather than using the django_jenkins plugin. This will expedite jenkins testing.
This commit is contained in:
@@ -3,9 +3,7 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
import glob
|
||||
from datetime import timedelta
|
||||
import tempfile
|
||||
|
||||
MONGO_DB = 'system_tracking'
|
||||
|
||||
@@ -119,13 +117,13 @@ ALLOWED_HOSTS = []
|
||||
# reverse proxy.
|
||||
REMOTE_HOST_HEADERS = ['REMOTE_ADDR', 'REMOTE_HOST']
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS += (
|
||||
TEMPLATE_CONTEXT_PROCESSORS += ( # NOQA
|
||||
'django.core.context_processors.request',
|
||||
'awx.ui.context_processors.settings',
|
||||
'awx.ui.context_processors.version',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES += (
|
||||
MIDDLEWARE_CLASSES += ( # NOQA
|
||||
'awx.main.middleware.HAMiddleware',
|
||||
'awx.main.middleware.ActivityStreamMiddleware',
|
||||
'crum.CurrentRequestUserMiddleware',
|
||||
@@ -247,7 +245,7 @@ EMAIL_USE_TLS = False
|
||||
# Use Django-Debug-Toolbar if installed.
|
||||
try:
|
||||
import debug_toolbar
|
||||
INSTALLED_APPS += ('debug_toolbar',)
|
||||
INSTALLED_APPS += (debug_toolbar.__name__,)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@@ -259,7 +257,7 @@ DEBUG_TOOLBAR_CONFIG = {
|
||||
# Use Django-devserver if installed.
|
||||
try:
|
||||
import devserver
|
||||
INSTALLED_APPS += ('devserver',)
|
||||
INSTALLED_APPS += (devserver.__name__,)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@@ -444,7 +442,7 @@ VMWARE_REGIONS_BLACKLIST = []
|
||||
|
||||
# Inventory variable name/values for determining whether a host is
|
||||
# active in vSphere.
|
||||
VMWARE_ENABLED_VAR = 'vmware_powerState'
|
||||
VMWARE_ENABLED_VAR = 'vmware_powerState'
|
||||
VMWARE_ENABLED_VALUE = 'poweredOn'
|
||||
|
||||
# Inventory variable name containing the unique instance ID.
|
||||
@@ -609,7 +607,7 @@ LOGGING = {
|
||||
'class':'logging.handlers.RotatingFileHandler',
|
||||
'filters': ['require_debug_false'],
|
||||
'filename': os.path.join(LOG_ROOT, 'tower_warnings.log'),
|
||||
'maxBytes': 1024*1024*5, # 5 MB
|
||||
'maxBytes': 1024 * 1024 * 5, # 5 MB
|
||||
'backupCount': 5,
|
||||
'formatter':'simple',
|
||||
},
|
||||
@@ -618,7 +616,7 @@ LOGGING = {
|
||||
'class':'logging.handlers.RotatingFileHandler',
|
||||
'filters': ['require_debug_false'],
|
||||
'filename': os.path.join(LOG_ROOT, 'callback_receiver.log'),
|
||||
'maxBytes': 1024*1024*5, # 5 MB
|
||||
'maxBytes': 1024 * 1024 * 5, # 5 MB
|
||||
'backupCount': 5,
|
||||
'formatter':'simple',
|
||||
},
|
||||
@@ -627,7 +625,7 @@ LOGGING = {
|
||||
'class':'logging.handlers.RotatingFileHandler',
|
||||
'filters': ['require_debug_false'],
|
||||
'filename': os.path.join(LOG_ROOT, 'socketio_service.log'),
|
||||
'maxBytes': 1024*1024*5, # 5 MB
|
||||
'maxBytes': 1024 * 1024 * 5, # 5 MB
|
||||
'backupCount': 5,
|
||||
'formatter':'simple',
|
||||
},
|
||||
@@ -636,7 +634,7 @@ LOGGING = {
|
||||
'class':'logging.handlers.RotatingFileHandler',
|
||||
'filters': ['require_debug_false'],
|
||||
'filename': os.path.join(LOG_ROOT, 'task_system.log'),
|
||||
'maxBytes': 1024*1024*5, # 5 MB
|
||||
'maxBytes': 1024 * 1024 * 5, # 5 MB
|
||||
'backupCount': 5,
|
||||
'formatter':'simple',
|
||||
},
|
||||
|
||||
@@ -6,13 +6,12 @@
|
||||
# Python
|
||||
import sys
|
||||
import traceback
|
||||
import glob
|
||||
|
||||
# Django Split Settings
|
||||
from split_settings.tools import optional, include
|
||||
|
||||
# Load default settings.
|
||||
from defaults import *
|
||||
from defaults import * # NOQA
|
||||
|
||||
MONGO_DB = 'system_tracking_dev'
|
||||
|
||||
@@ -31,27 +30,24 @@ AWX_PROOT_ENABLED = True
|
||||
# Use Django-Jenkins if installed. Only run tests for awx.main app.
|
||||
try:
|
||||
import django_jenkins
|
||||
INSTALLED_APPS += ('django_jenkins',)
|
||||
INSTALLED_APPS += (django_jenkins.__name__,)
|
||||
PROJECT_APPS = ('awx.main.tests', 'awx.api.tests', 'awx.fact.tests',)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
if 'django_jenkins' in INSTALLED_APPS:
|
||||
JENKINS_TASKS = (
|
||||
'django_jenkins.tasks.run_pylint',
|
||||
'django_jenkins.tasks.run_flake8',
|
||||
# 'django_jenkins.tasks.run_pylint',
|
||||
# 'django_jenkins.tasks.run_flake8',
|
||||
# The following are not needed when including run_flake8
|
||||
# 'django_jenkins.tasks.run_pep8',
|
||||
# 'django_jenkins.tasks.run_pyflakes',
|
||||
# The following are handled by various grunt tasks and no longer required
|
||||
# 'django_jenkins.tasks.run_jshint',
|
||||
# 'django_jenkins.tasks.run_csslint',
|
||||
)
|
||||
)
|
||||
PEP8_RCFILE = "setup.cfg"
|
||||
PYLINT_RCFILE = ".pylintrc"
|
||||
CSSLINT_CHECKED_FILES = glob.glob(os.path.join(BASE_DIR, 'ui/static/less/*.less'))
|
||||
JSHINT_CHECKED_FILES = [os.path.join(BASE_DIR, 'ui/static/js'),
|
||||
os.path.join(BASE_DIR, 'ui/static/lib/ansible'),]
|
||||
|
||||
# Much faster than the default
|
||||
# https://docs.djangoproject.com/en/1.6/topics/auth/passwords/#how-django-stores-passwords
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
# Development settings for AWX project, but with DEBUG disabled
|
||||
|
||||
# Load development settings.
|
||||
from defaults import *
|
||||
from defaults import * # NOQA
|
||||
|
||||
# Load development settings.
|
||||
from development import *
|
||||
from development import * # NOQA
|
||||
|
||||
# Disable capturing DEBUG
|
||||
DEBUG = False
|
||||
|
||||
@@ -12,7 +12,7 @@ import traceback
|
||||
from split_settings.tools import optional, include
|
||||
|
||||
# Load default settings.
|
||||
from defaults import *
|
||||
from defaults import * # NOQA
|
||||
|
||||
DEBUG = False
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
@@ -49,7 +49,7 @@ LOGGING['handlers']['tower_warnings'] = {
|
||||
'class':'logging.handlers.RotatingFileHandler',
|
||||
'filters': ['require_debug_false'],
|
||||
'filename': '/var/log/tower/tower.log',
|
||||
'maxBytes': 1024*1024*5, # 5 MB
|
||||
'maxBytes': 1024 * 1024 * 5, # 5 MB
|
||||
'backupCount': 5,
|
||||
'formatter':'simple',
|
||||
}
|
||||
@@ -60,7 +60,7 @@ LOGGING['handlers']['callback_receiver'] = {
|
||||
'class':'logging.handlers.RotatingFileHandler',
|
||||
'filters': ['require_debug_false'],
|
||||
'filename': '/var/log/tower/callback_receiver.log',
|
||||
'maxBytes': 1024*1024*5, # 5 MB
|
||||
'maxBytes': 1024 * 1024 * 5, # 5 MB
|
||||
'backupCount': 5,
|
||||
'formatter':'simple',
|
||||
}
|
||||
@@ -70,7 +70,7 @@ LOGGING['handlers']['socketio_service'] = {
|
||||
'class':'logging.handlers.RotatingFileHandler',
|
||||
'filters': ['require_debug_false'],
|
||||
'filename': '/var/log/tower/socketio_service.log',
|
||||
'maxBytes': 1024*1024*5, # 5 MB
|
||||
'maxBytes': 1024 * 1024 * 5, # 5 MB
|
||||
'backupCount': 5,
|
||||
'formatter':'simple',
|
||||
}
|
||||
@@ -80,7 +80,7 @@ LOGGING['handlers']['task_system'] = {
|
||||
'class':'logging.handlers.RotatingFileHandler',
|
||||
'filters': ['require_debug_false'],
|
||||
'filename': '/var/log/tower/task_system.log',
|
||||
'maxBytes': 1024*1024*5, # 5 MB
|
||||
'maxBytes': 1024 * 1024 * 5, # 5 MB
|
||||
'backupCount': 5,
|
||||
'formatter':'simple',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user