From cc2b09ec5e2a692c16df2c7824e5ad1ec1fee504 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Thu, 16 Mar 2017 13:48:51 -0700 Subject: [PATCH] flake8: Specify 'nova' as name of app Specify 'nova' as the name of the application for the flake8-import-order plugin. That way it knows that imports of nova should come after external libraries. Fix issues discovered in ordering by this new check. Change-Id: I822796ba3d750f93de813035aeee59e8ccb022a2 --- nova/api/openstack/placement/wsgi.py | 4 ++-- nova/conf/database.py | 4 ++-- tox.ini | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nova/api/openstack/placement/wsgi.py b/nova/api/openstack/placement/wsgi.py index 087a0f59b..c982f90f9 100644 --- a/nova/api/openstack/placement/wsgi.py +++ b/nova/api/openstack/placement/wsgi.py @@ -18,12 +18,12 @@ import logging as py_logging import os import os.path +from oslo_log import log as logging + from nova.api.openstack.placement import deploy from nova import conf from nova import config -from oslo_log import log as logging - CONFIG_FILE = 'nova.conf' diff --git a/nova/conf/database.py b/nova/conf/database.py index e2a3483c6..b0d64db35 100644 --- a/nova/conf/database.py +++ b/nova/conf/database.py @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from nova.conf import paths - from oslo_config import cfg from oslo_db import options as oslo_db_options +from nova.conf import paths + _DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('nova.sqlite') diff --git a/tox.ini b/tox.ini index db0f286e4..bfbaf586d 100644 --- a/tox.ini +++ b/tox.ini @@ -160,6 +160,7 @@ enable-extensions = H106,H203,H904 ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405 exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools/xenserver*,releasenotes import-order-style = pep8 +application-import-names = nova # To get a list of functions that are more complex than 25, set max-complexity # to 25 and run 'tox -epep8'. # 34 is currently the most complex thing we have