Enable H307 PEP8 check

Fixes files with the PEP8 error:

    H307  like imports should be grouped together

and enables the check in tox.ini.

For the modified files, made sure the import order matches the
template as described in:

http://docs.openstack.org/developer/hacking/#import-order-template

This order is currently: stdlib, 3rd-party, and project imports.

Change-Id: I4538356c207535b778da1273aadcf3b4a7b20383
This commit is contained in:
David Shrewsbury 2014-10-13 10:09:53 -04:00
parent e8a5b3ab62
commit 8858c610a9
21 changed files with 14 additions and 34 deletions

View File

@ -18,7 +18,6 @@
import pecan
from pecan import rest
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan

View File

@ -24,7 +24,6 @@ Specification can be found at ironic/doc/api/v1.rst
import pecan
from pecan import rest
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan

View File

@ -14,10 +14,10 @@
# under the License.
import datetime
import six
import pecan
from pecan import rest
import six
import wsme
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan

View File

@ -15,7 +15,6 @@
import pecan
from pecan import rest
import wsme
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan

View File

@ -14,9 +14,8 @@
# under the License.
import jsonpatch
import wsme
from oslo.config import cfg
import wsme
from ironic.common.i18n import _

View File

@ -23,9 +23,8 @@ import sys
from oslo.config import cfg
from ironic.openstack.common import service
from ironic.common import service as ironic_service
from ironic.openstack.common import service
CONF = cfg.CONF

View File

@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import stevedore
from oslo.config import cfg
import stevedore
from ironic.common import exception
from ironic.openstack.common import lockutils

View File

@ -21,17 +21,15 @@ import os
import sys
import time
import sendfile
from glanceclient import client
from oslo.config import cfg
import sendfile
import six.moves.urllib.parse as urlparse
from ironic.common import exception
from ironic.common.glance_service import service_utils
from ironic.common.i18n import _LE
from oslo.config import cfg
LOG = logging.getLogger(__name__)
CONF = cfg.CONF

View File

@ -47,7 +47,6 @@ import threading
import eventlet
from eventlet import greenpool
from oslo.config import cfg
from oslo import messaging
from oslo.utils import excutils

View File

@ -96,10 +96,9 @@ code when the spawned task generates an exception:
"""
import retrying
from oslo.config import cfg
from oslo.utils import excutils
import retrying
from ironic.common import driver_factory
from ironic.common import exception

View File

@ -28,10 +28,10 @@ models.
"""
import abc
import six
from oslo.config import cfg
from oslo.utils import importutils
import six
from ironic.common import exception
from ironic.common.i18n import _

View File

@ -16,11 +16,9 @@ Tests for ACL. Checks whether certain kinds of requests
are blocked or allowed to be processed.
"""
import mock
# NOTE(deva): import auth_token so we can override a config option
from keystonemiddleware import auth_token # noqa
import mock
from oslo.config import cfg
from ironic.tests.api import base

View File

@ -21,17 +21,15 @@ inline callbacks.
"""
import eventlet
eventlet.monkey_patch(os=False)
import copy
import os
import sys
import eventlet
eventlet.monkey_patch(os=False)
import fixtures
import testtools
from oslo.config import cfg
import testtools
from ironic.common import hash_ring
from ironic.objects import base as objects_base

View File

@ -17,7 +17,6 @@ from oslo.db import exception as db_exc
from ironic.common import utils as ironic_utils
import ironic.db.sqlalchemy.api as sa_api
from ironic.db.sqlalchemy import models
from ironic.tests.db import base

View File

@ -19,7 +19,6 @@ import six
from ironic.common import exception
from ironic.common import utils as ironic_utils
from ironic.tests.db import base
from ironic.tests.db import utils

View File

@ -19,7 +19,6 @@ import six
from ironic.common import exception
from ironic.common import utils as ironic_utils
from ironic.tests.db import base
from ironic.tests.db import utils as db_utils

View File

@ -13,9 +13,9 @@
# limitations under the License.
import json
import requests
import mock
import requests
from ironic.common import exception
from ironic.drivers.modules import agent_client

View File

@ -20,7 +20,6 @@ Test class for Native IPMI power driver module.
"""
import mock
from oslo.config import cfg
from pyghmi import exceptions as pyghmi_exception

View File

@ -21,7 +21,6 @@
"""Test class for SNMP power driver module."""
import mock
from oslo.config import cfg
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pysnmp import error as snmp_error

View File

@ -19,7 +19,6 @@ from testtools.matchers import HasLength
from ironic.common import exception
from ironic.common import utils as ironic_utils
from ironic import objects
from ironic.tests.db import base
from ironic.tests.db import utils

View File

@ -47,7 +47,7 @@ commands = {posargs}
[flake8]
# E711: ignored because it is normal to use "column == None" in sqlalchemy
# TODO(yuriyz): Analyze or fix the warnings blacklisted below
ignore = E12,E111,E113,E131,E265,E711,F812,H305,H307
ignore = E12,E111,E113,E131,E265,E711,F812,H305
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,*ironic/nova*
[hacking]