Skip to content

Commit

Permalink
flake8: Specify 'nova' as name of app
Browse files Browse the repository at this point in the history
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
  • Loading branch information
John L. Villalovos committed Mar 16, 2017
1 parent a5d4adb commit 07a042b
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions nova/api/openstack/placement/wsgi.py
Expand Up @@ -18,12 +18,12 @@
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'


Expand Down
4 changes: 2 additions & 2 deletions nova/conf/database.py
Expand Up @@ -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')


Expand Down
4 changes: 2 additions & 2 deletions nova/conf/xvp.py
Expand Up @@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.

from nova.conf import paths

from oslo_config import cfg

from nova.conf import paths

xvp_group = cfg.OptGroup(
'xvp',
title='XVP options',
Expand Down
Expand Up @@ -15,6 +15,7 @@
import datetime

import iso8601
from oslo_config import cfg

from nova.api.openstack.compute import availability_zone as az_v21
from nova.api.openstack.compute import extension_info
Expand All @@ -30,7 +31,6 @@
from nova.tests.unit.image import fake
from nova.tests.unit import matchers
from nova.tests.unit.objects import test_service
from oslo_config import cfg

FAKE_UUID = fakes.FAKE_UUID

Expand Down
2 changes: 1 addition & 1 deletion nova/tests/unit/api/openstack/test_wsgi.py
Expand Up @@ -11,6 +11,7 @@
# under the License.

import mock
from oslo_serialization import jsonutils
import six
import testscenarios
import webob
Expand All @@ -24,7 +25,6 @@
from nova.tests.unit.api.openstack import fakes
from nova.tests.unit import matchers
from nova.tests.unit import utils
from oslo_serialization import jsonutils


class MicroversionedTest(testscenarios.WithScenarios, test.NoDBTestCase):
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/unit/compute/test_host_api.py
Expand Up @@ -18,6 +18,7 @@

import mock
from oslo_serialization import jsonutils
import testtools

from nova.api.openstack.compute import services
from nova.cells import utils as cells_utils
Expand All @@ -32,7 +33,6 @@
from nova.tests.unit import fake_notifier
from nova.tests.unit.objects import test_objects
from nova.tests.unit.objects import test_service
import testtools


class ComputeHostAPITestCase(test.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/unit/objects/test_security_group.py
Expand Up @@ -13,13 +13,13 @@
# under the License.

import mock
from oslo_versionedobjects import fixture as ovo_fixture

from nova import db
from nova.objects import instance
from nova.objects import security_group
from nova.tests.unit.objects import test_objects
from nova.tests import uuidsentinel as uuids
from oslo_versionedobjects import fixture as ovo_fixture


fake_secgroup = {
Expand Down
3 changes: 1 addition & 2 deletions nova/tests/unit/volume/test_cinder.py
Expand Up @@ -16,6 +16,7 @@
from cinderclient import exceptions as cinder_exception
from keystoneclient import exceptions as keystone_exception
import mock
from oslo_utils import timeutils

import nova.conf
from nova import context
Expand All @@ -25,8 +26,6 @@
from nova.tests import uuidsentinel as uuids
from nova.volume import cinder

from oslo_utils import timeutils

CONF = nova.conf.CONF


Expand Down
1 change: 1 addition & 0 deletions tox.ini
Expand Up @@ -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
Expand Down

0 comments on commit 07a042b

Please sign in to comment.