Enable H305 PEP8 check

Fixes files with the PEP8 error:

    H305  imports not grouped correctly

and enables the check in tox.ini.

Import order is: stdlib, 3rd-party, project imports

Change-Id: I81fc67bc9f79c514b6f4941a13e44c95badd34e2
This commit is contained in:
David Shrewsbury 2014-10-13 10:21:25 -04:00
parent 8858c610a9
commit cfcc3ec733
18 changed files with 24 additions and 18 deletions

View File

@ -23,9 +23,10 @@ Based on pecan.middleware.errordocument
"""
import json
import webob
from xml import etree as et
import webob
from ironic.common.i18n import _
from ironic.common.i18n import _LE
from ironic.openstack.common import log

View File

@ -19,10 +19,10 @@
import logging
import sys
from wsgiref import simple_server
from oslo.config import cfg
from six.moves import socketserver
from wsgiref import simple_server
from ironic.api import app
from ironic.common.i18n import _LI

View File

@ -14,12 +14,12 @@
# under the License.
from oslo.config import cfg
from stevedore import dispatch
from ironic.common import exception
from ironic.common.i18n import _LI
from ironic.openstack.common import lockutils
from ironic.openstack.common import log
from stevedore import dispatch
LOG = log.getLogger(__name__)

View File

@ -15,6 +15,7 @@
"""Tests for the Pecan API hooks."""
import json
import mock
from oslo.config import cfg
from oslo import messaging

View File

@ -14,6 +14,7 @@
# under the License.
import json
import mock
from testtools.matchers import HasLength

View File

@ -17,10 +17,11 @@
"""Test utils for Ironic Managers."""
from ironic.common import driver_factory
import pkg_resources
from stevedore import dispatch
from ironic.common import driver_factory
def mock_the_extension_manager(driver="fake", namespace="ironic.drivers"):
"""Get a fake stevedore NameDispatchExtensionManager instance.

View File

@ -15,9 +15,10 @@
Test class for DRAC client wrapper.
"""
import mock
from xml.etree import ElementTree
import mock
from ironic.common import exception
from ironic.drivers.modules.drac import client as drac_client
from ironic.tests import base

View File

@ -15,9 +15,9 @@
"""Test class for common methods used by iLO modules."""
import mock
import tempfile
import mock
from oslo.config import cfg
from oslo.utils import importutils

View File

@ -15,9 +15,9 @@
"""Test class for common methods used by iLO modules."""
import mock
import tempfile
import mock
from oslo.config import cfg
from ironic.common import exception

View File

@ -17,13 +17,13 @@
"""Test class for console_utils driver module."""
import mock
import os
import random
import string
import subprocess
import tempfile
import mock
from oslo.config import cfg
from ironic.common import exception

View File

@ -14,11 +14,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import fixtures
import mock
import os
import tempfile
import fixtures
import mock
from oslo.config import cfg
from ironic.common import disk_partitioner

View File

@ -16,11 +16,12 @@
"""Tests for ImageCache class and helper functions."""
import mock
import os
import tempfile
import time
import mock
from ironic.common import exception
from ironic.common import image_service
from ironic.common import images

View File

@ -19,12 +19,12 @@
"""Test class for IPMITool driver module."""
import mock
import os
import stat
import tempfile
import time
import mock
from oslo.config import cfg
from ironic.common import boot_devices

View File

@ -15,10 +15,10 @@
"""Test class for iSCSI deploy mechanism."""
import mock
import os
import tempfile
import mock
from oslo.config import cfg
from ironic.common import exception

View File

@ -17,11 +17,11 @@
"""Test class for PXE driver."""
import fixtures
import mock
import os
import tempfile
import fixtures
import mock
from oslo.config import cfg
from oslo.serialization import jsonutils as json

View File

@ -16,10 +16,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import os
import shutil
import mock
from oslo.config import cfg
import six.moves.builtins as __builtin__

View File

@ -13,9 +13,9 @@
# under the License.
import __builtin__
import mock
import sys
import mock
from oslo.config import cfg
from swiftclient import client as swift_client
from swiftclient import exceptions as swift_exception

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
ignore = E12,E111,E113,E131,E265,E711,F812
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,*ironic/nova*
[hacking]