Fix and gate on H305 and H307

Both H305 and H307 are part of the OpenStack style guide.

Ensure that there are 3 groups of imports, stdlib,
third-party and project specific. Within each category
ensure that imports are in alphabetical order.

Change-Id: Id4994551c135c3c1a4982153f0c6cacba6176b95
This commit is contained in:
Davanum Srinivas 2014-07-09 17:00:21 -04:00 committed by Davanum Srinivas (dims)
parent 35abfd1d08
commit f3dc6eefe7
97 changed files with 124 additions and 117 deletions

View File

@ -19,10 +19,11 @@ APIRequest class
"""
import datetime
from lxml import etree
# TODO(termie): replace minidom with etree
from xml.dom import minidom
from lxml import etree
from nova.api.ec2 import ec2utils
from nova import exception
from nova.openstack.common import log as logging

View File

@ -15,6 +15,7 @@
# under the License.
import re
import webob
from nova.api.openstack import extensions

View File

@ -18,6 +18,7 @@
import contextlib
import json
import webob
from webob import exc

View File

@ -16,11 +16,11 @@
import base64
import re
import stevedore
from oslo.config import cfg
from oslo import messaging
import six
import stevedore
import webob
from webob import exc

View File

@ -13,10 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import paste.urlmap
import re
import urllib2
import paste.urlmap
from nova.api.openstack import wsgi

View File

@ -14,14 +14,14 @@
# under the License.
import os.path
from lxml import etree
import six
from xml.dom import minidom
from xml.parsers import expat
from xml import sax
from xml.sax import expatreader
from lxml import etree
import six
from nova import exception
from nova.openstack.common.gettextutils import _
from nova import utils

View File

@ -30,6 +30,7 @@ if ('eventlet' in sys.modules and
os.environ['EVENTLET_NO_GREENDNS'] = 'yes'
import eventlet
from nova import debugger
if debugger.enabled():

View File

@ -16,16 +16,15 @@
"""Starter script for Bare-Metal Deployment Service."""
import os
import sys
import threading
import time
import cgi
import os
import Queue
import re
import socket
import stat
import sys
import threading
import time
from wsgiref import simple_server
from nova import config

View File

@ -55,10 +55,10 @@
from __future__ import print_function
import argparse
import decorator
import os
import sys
import decorator
import netaddr
from oslo.config import cfg
from oslo import messaging

View File

@ -23,9 +23,8 @@ that needs to be implemented by Resource Monitor.
import functools
import types
import six
from oslo.config import cfg
import six
from nova import loadables
from nova.openstack.common.gettextutils import _

View File

@ -14,8 +14,8 @@
import abc
import datetime
import iso8601
import iso8601
import netaddr
import six

View File

@ -13,7 +13,6 @@
# under the License.
import netaddr
from oslo.config import cfg
from nova import db

View File

@ -33,14 +33,15 @@
"""
import copy
import jsonschema
from oslo.config import cfg
from nova import exception
from nova.openstack.common import jsonutils
from nova.openstack.common import log as logging
from nova.pci import pci_utils
from nova import utils
from oslo.config import cfg
pci_alias_opts = [
cfg.MultiStrOpt('pci_alias',

View File

@ -15,6 +15,7 @@
import operator
import six
from nova.openstack.common import jsonutils

View File

@ -20,12 +20,12 @@ import base64
import copy
import datetime
import functools
import iso8601
import os
import string
import tempfile
import fixtures
import iso8601
import mock
from oslo.config import cfg

View File

@ -13,6 +13,7 @@
# under the License.
import datetime
from lxml import etree
import webob

View File

@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import webob
from oslo.config import cfg
import webob
from nova.consoleauth import rpcapi as consoleauth_rpcapi
from nova import context

View File

@ -14,6 +14,7 @@
# under the License.
import string
import webob
from nova.compute import api as compute_api

View File

@ -14,8 +14,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from lxml import etree
import urllib
from lxml import etree
import webob
from nova.api.openstack.compute.contrib import floating_ip_dns

View File

@ -15,8 +15,8 @@
import calendar
import datetime
import iso8601
import iso8601
import mock
import webob.exc

View File

@ -13,6 +13,7 @@
# under the License.
import uuid
import webob
from nova.api.openstack.compute.contrib import shelve

View File

@ -13,8 +13,9 @@
# under the License.
import datetime
from oslo.config import cfg
import uuid
from oslo.config import cfg
import webob
from nova.api.openstack.compute import plugins

View File

@ -17,12 +17,11 @@ import six.moves.urllib.parse as urlparse
import webob
from nova.api.openstack.compute.plugins.v3 import flavors
from nova.openstack.common import jsonutils
import nova.compute.flavors
from nova import context
from nova import db
from nova import exception
from nova.openstack.common import jsonutils
from nova import test
from nova.tests.api.openstack import fakes
from nova.tests import matchers

View File

@ -14,8 +14,9 @@
# under the License.
import datetime
from oslo.config import cfg
import uuid
from oslo.config import cfg
import webob
from nova.api.openstack.compute import plugins

View File

@ -14,8 +14,8 @@
import calendar
import datetime
import iso8601
import iso8601
import mock
import webob.exc

View File

@ -13,6 +13,7 @@
# under the License.
import uuid
import webob
from nova.api.openstack.compute.plugins.v3 import shelve

View File

@ -17,12 +17,13 @@
Test suites for 'common' code used throughout the OpenStack HTTP API.
"""
import xml.dom.minidom as minidom
from lxml import etree
import mock
from testtools import matchers
import webob
import webob.exc
import xml.dom.minidom as minidom
from nova.api.openstack import common
from nova.api.openstack import xmlutil

View File

@ -11,6 +11,7 @@
# under the License.
import inspect
import webob
from nova.api.openstack import extensions

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from lxml import etree
from xml.dom import minidom
from lxml import etree
from nova.api.openstack import xmlutil
from nova import exception
from nova import test

View File

@ -13,6 +13,7 @@
# under the License.
import json
from oslo.config import cfg
import webob
import webob.exc

View File

@ -12,8 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
import StringIO
from oslo.config import cfg
import webob
import nova.api.sizelimit

View File

@ -22,20 +22,19 @@ import contextlib
import datetime
import operator
import sys
import testtools
import time
import traceback
import uuid
from eventlet import greenthread
import mock
import mox
from oslo.config import cfg
from oslo import messaging
import six
import testtools
from testtools import matchers as testtools_matchers
from eventlet import greenthread
import nova
from nova import availability_zones
from nova import block_device

View File

@ -16,6 +16,7 @@
import contextlib
import copy
import datetime
import iso8601
import mock
import mox

View File

@ -15,9 +15,9 @@
"""Tests for compute resource tracking."""
import mock
import uuid
import mock
from oslo.config import cfg
from nova.compute import flavors

View File

@ -12,11 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from nova.compute import vm_mode
from nova import exception
from nova import test
from nova.compute import vm_mode
class ComputeVMModeTest(test.NoDBTestCase):

View File

@ -16,6 +16,7 @@
"""Tests for the conductor service."""
import contextlib
import mock
import mox
from oslo import messaging

View File

@ -19,6 +19,7 @@ Tests for Consoleauth Code.
"""
import mox
from nova.consoleauth import manager
from nova import context
from nova import db

View File

@ -20,11 +20,11 @@
import copy
import datetime
import iso8601
import types
import uuid as stdlib_uuid
import eventlet
import iso8601
import mox
import netaddr
from oslo.config import cfg
@ -61,7 +61,6 @@ from nova import test
from nova.tests import matchers
from nova import utils
CONF = cfg.CONF
CONF.import_opt('reserved_host_memory_mb', 'nova.compute.resource_tracker')
CONF.import_opt('reserved_host_disk_mb', 'nova.compute.resource_tracker')

View File

@ -17,12 +17,13 @@
"""Test cases for sqlite-specific logic"""
from nova import test
from sqlalchemy import create_engine
from sqlalchemy import Column, BigInteger, String
import sqlalchemy.engine.reflection
from sqlalchemy.ext.declarative import declarative_base
from nova import test
class TestSqlite(test.NoDBTestCase):
"""Tests for sqlite-specific logic."""

View File

@ -18,17 +18,15 @@ import datetime
import filecmp
import os
import random
import sys
import tempfile
import time
import sys
import testtools
import glanceclient.exc
import mock
import mox
import glanceclient.exc
from oslo.config import cfg
import testtools
from nova import context
from nova import exception
@ -37,7 +35,6 @@ from nova import test
from nova.tests.api.openstack import fakes
from nova.tests.glance import stubs as glance_stubs
from nova import utils
import nova.virt.libvirt.utils as lv_utils
CONF = cfg.CONF

View File

@ -14,12 +14,12 @@
# under the License.
import binascii
import eventlet
import mox
import os
import tempfile
import eventlet
import fixtures
import mox
from nova.api.ec2 import ec2utils
from nova import context

View File

@ -17,12 +17,13 @@
Test multiprocess enabled API service.
"""
import errno
import fixtures
import os
import signal
import time
import traceback
import fixtures
from nova.openstack.common import log as logging
from nova import service
from nova.tests.integrated.api import client

View File

@ -18,9 +18,8 @@
import pprint
from testtools import content
from lxml import etree
from testtools import content
class DictKeysMismatch(object):

View File

@ -14,7 +14,6 @@
# under the License.
#
import mox
from neutronclient.common import exceptions as n_exc
from neutronclient.v2_0 import client

View File

@ -16,6 +16,7 @@
# under the License.
import contextlib
import fixtures
import mock
import mox

View File

@ -13,8 +13,8 @@
# under the License.
import datetime
import iso8601
import iso8601
import netaddr
from nova.network import model as network_model

View File

@ -13,6 +13,7 @@
# under the License.
import contextlib
import mock
from nova import db

View File

@ -12,9 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import traceback
import mock
from nova import db
from nova.objects import instance_action
from nova.openstack.common import timeutils

View File

@ -17,9 +17,9 @@ Tests For Filter Scheduler.
"""
import contextlib
import mock
import uuid
import mock
import mox
from nova.compute import utils as compute_utils

View File

@ -12,14 +12,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from cinderclient import exceptions as cinder_exception
import six.moves.urllib.parse as urlparse
from cinderclient import exceptions as cinder_exception
from nova import context
from nova import exception
from nova.volume import cinder
from nova import test
from nova.volume import cinder
def _stub_volume(**kwargs):

View File

@ -14,16 +14,16 @@
# under the License.
import mox
import os
import tempfile
from nova import test
import mox
from oslo.config import cfg
from nova.openstack.common import fileutils
from nova import test
from nova import utils
from nova.virt import configdrive
from oslo.config import cfg
CONF = cfg.CONF

View File

@ -20,7 +20,6 @@ import base64
import hashlib
import hmac
import json
import mock
import re
try:
@ -28,6 +27,7 @@ try:
except ImportError:
import pickle
import mock
from oslo.config import cfg
import webob

View File

@ -13,10 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import fixtures
import StringIO
import sys
import fixtures
from nova.cmd import manage
from nova import context
from nova import db

View File

@ -18,11 +18,11 @@
Unittets for S3 objectstore clone.
"""
import boto
import os
import shutil
import tempfile
import boto
from boto import exception as boto_exception
from boto.s3 import connection as s3
from oslo.config import cfg

View File

@ -19,24 +19,23 @@ Unit Tests for remote procedure calls using queue
"""
import sys
import testtools
import mock
import mox
from oslo.config import cfg
import testtools
from nova import context
from nova import db
from nova import exception
from nova import manager
from nova.openstack.common import service as _service
from nova import rpc
from nova import service
from nova import test
from nova.tests import utils
from nova import wsgi
from nova.openstack.common import service as _service
test_service_opts = [
cfg.StrOpt("fake_manager",
default="nova.tests.test_service.FakeManager",

View File

@ -18,20 +18,20 @@
import os.path
import tempfile
import testtools
import urllib2
import eventlet
import eventlet.wsgi
import mock
from oslo.config import cfg
import requests
import testtools
import webob
import nova.exception
from nova import test
from nova.tests import utils
import nova.wsgi
from oslo.config import cfg
import urllib2
import webob
SSL_CERT_DIR = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)),

View File

@ -21,7 +21,6 @@
import os
import mox
from oslo.config import cfg
from testtools import matchers

View File

@ -20,7 +20,6 @@
import os
import mox
from oslo.config import cfg
from nova import exception

View File

@ -15,7 +15,6 @@
import mock
from nova import test
from nova.virt.hyperv import networkutilsv2
from nova.virt.hyperv import vmutils

View File

@ -13,7 +13,6 @@
# under the License.
from nova import test
from nova.virt.hyperv import rdpconsoleutils

View File

@ -15,7 +15,6 @@
import mock
from nova import test
from nova.virt.hyperv import rdpconsoleutilsv2

View File

@ -15,7 +15,6 @@
import mock
from nova import test
from nova.virt.hyperv import constants
from nova.virt.hyperv import vhdutils
from nova.virt.hyperv import vmutils

View File

@ -14,9 +14,8 @@
import mock
from nova import test
from nova.openstack.common import units
from nova import test
from nova.virt.hyperv import constants
from nova.virt.hyperv import vhdutilsv2

View File

@ -16,7 +16,6 @@
import mock
from nova import test
from nova.virt.hyperv import vmutils

View File

@ -15,7 +15,6 @@
import mock
from nova import test
from nova.virt.hyperv import vmutilsv2

View File

@ -16,21 +16,21 @@
import contextlib
import copy
import errno
import eventlet
import fixtures
import functools
import mox
import os
import re
import shutil
import tempfile
import uuid
from xml.dom import minidom
import eventlet
from eventlet import greenthread
import fixtures
from lxml import etree
import mock
import mox
from oslo.config import cfg
from xml.dom import minidom
from nova.api.ec2 import cloud
from nova.compute import flavors
@ -7864,7 +7864,7 @@ class IptablesFirewallTestCase(test.TestCase):
from nova.network import linux_net
linux_net.iptables_manager.execute = fake_iptables_execute
from nova.compute import utils as compute_utils
from nova.compute import utils as compute_utils # noqa
self.stubs.Set(compute_utils, 'get_nw_info_for_instance',
lambda instance: network_model)

View File

@ -13,6 +13,7 @@
# under the License.
import contextlib
from lxml import etree
import mock
from oslo.config import cfg

View File

@ -14,10 +14,10 @@
# under the License.
import contextlib
import fixtures
import os
import time
import fixtures
import mock
from oslo.config import cfg

View File

@ -16,7 +16,6 @@ import sys
from nova import exception
from nova import test
from nova.tests import fakeguestfs
from nova.virt.disk.vfs import guestfs as vfsimpl

View File

@ -19,7 +19,6 @@ from nova.openstack.common import processutils
from nova import test
from nova.tests import utils as tests_utils
import nova.utils
from nova.virt.disk.vfs import localfs as vfsimpl
CONF = cfg.CONF

View File

@ -13,10 +13,10 @@
# under the License.
import base64
import fixtures
import sys
import traceback
import fixtures
import mock
import netaddr
import six

View File

@ -15,8 +15,8 @@
import contextlib
import copy
import fixtures
import fixtures
import mock
import mox

View File

@ -13,6 +13,7 @@
# under the License.
import contextlib
import mock
from nova.openstack.common import units

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import contextlib
import datetime
import contextlib
import mock
from oslo.config import cfg

View File

@ -13,6 +13,7 @@
# under the License.
import collections
import fixtures
import mock

View File

@ -15,9 +15,9 @@
# under the License.
import collections
import contextlib
import re
import contextlib
import mock
from nova import exception

View File

@ -13,6 +13,7 @@
# under the License.
import contextlib
import mock
from nova import test

View File

@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import pkg_resources
import mox
import pkg_resources
from nova import context
from nova.openstack.common.gettextutils import _

View File

@ -14,9 +14,10 @@
# under the License.
import contextlib
import eventlet
import tarfile
import eventlet
from nova.image import glance
from nova import test
from nova.virt.xenapi.client import session as xenapi_session

View File

@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from eventlet import greenthread
import mock
from nova import exception
from nova import test

View File

@ -2622,7 +2622,7 @@ class XenAPIDom0IptablesFirewallTestCase(stubs.XenAPITestBase):
network_model = fake_network.fake_get_instance_nw_info(self.stubs, 1)
from nova.compute import utils as compute_utils
from nova.compute import utils as compute_utils # noqa
self.stubs.Set(compute_utils, 'get_nw_info_for_instance',
lambda instance: network_model)

View File

@ -19,12 +19,12 @@ import os
import shutil
import tempfile
from nova.openstack.common import strutils
from oslo.config import cfg
from nova import exception
from nova.openstack.common import fileutils
from nova.openstack.common import log as logging
from nova.openstack.common import strutils
from nova.openstack.common import units
from nova import utils
from nova import version

View File

@ -16,10 +16,11 @@
import os
import shutil
from oslo.config import cfg
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova import utils
from oslo.config import cfg
LOG = logging.getLogger(__name__)

View File

@ -29,10 +29,11 @@ import sys
if sys.platform == 'win32':
import wmi
from xml.etree import ElementTree
from nova.openstack.common.gettextutils import _
from nova.virt.hyperv import constants
from nova.virt.hyperv import vmutils
from xml.etree import ElementTree
VHD_HEADER_SIZE_FIX = 512

View File

@ -24,13 +24,14 @@ import sys
if sys.platform == 'win32':
import wmi
from xml.etree import ElementTree
from nova.openstack.common.gettextutils import _
from nova.openstack.common import units
from nova.virt.hyperv import constants
from nova.virt.hyperv import vhdutils
from nova.virt.hyperv import vmutils
from nova.virt.hyperv import vmutilsv2
from xml.etree import ElementTree
VHDX_BAT_ENTRY_SIZE = 8

View File

@ -26,7 +26,6 @@ Supports KVM, LXC, QEMU, UML, and XEN.
"""
import errno
import eventlet
import functools
import glob
import mmap
@ -39,6 +38,7 @@ import threading
import time
import uuid
import eventlet
from eventlet import greenio
from eventlet import greenthread
from eventlet import patcher

View File

@ -17,9 +17,8 @@ import abc
import contextlib
import os
import six
from oslo.config import cfg
import six
from nova import exception
from nova.openstack.common import excutils

View File

@ -17,10 +17,11 @@ import json
import os
import time
from oslo.config import cfg
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova import utils
from oslo.config import cfg
LOG = logging.getLogger(__name__)

View File

@ -17,7 +17,6 @@
Exception classes and SOAP response error checking module.
"""
from nova import exception
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging

View File

@ -50,13 +50,12 @@ A fake XenAPI SDK.
import base64
import pickle
import pprint
import random
import uuid
from xml.sax import saxutils
import zlib
import pprint
from nova import exception
from nova.openstack.common.gettextutils import _
from nova.openstack.common import jsonutils

View File

@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import pkg_resources
from oslo.config import cfg
import pkg_resources
import six.moves.urllib.parse as urlparse
from nova.openstack.common.gettextutils import _

View File

@ -14,11 +14,12 @@
# under the License.
import contextlib
import eventlet
from eventlet import greenio
import os
import tarfile
import eventlet
from eventlet import greenio
from nova.image import glance
from nova import utils
from nova.virt.xenapi import vm_utils

View File

@ -17,13 +17,13 @@
"""Eventlet WSGI Services to proxy VNC for XCP protocol."""
import socket
import webob
import eventlet
import eventlet.green
import eventlet.greenio
import eventlet.wsgi
from oslo.config import cfg
import webob
from nova.consoleauth import rpcapi as consoleauth_rpcapi
from nova import context

View File

@ -21,6 +21,7 @@ from __future__ import print_function
import os.path
import socket
import ssl
import sys
import eventlet
@ -29,7 +30,6 @@ import greenlet
from oslo.config import cfg
from paste import deploy
import routes.middleware
import ssl
import webob.dec
import webob.exc

View File

@ -23,6 +23,7 @@ import gettext
import logging
import logging.handlers
import time
import XenAPI

View File

@ -29,7 +29,7 @@ except ImportError:
import utils # noqa
import XenAPIPlugin
import XenAPIPlugin # noqa
import pluginlib_nova as pluginlib # noqa
pluginlib.configure_logging("xenstore")

View File

@ -61,7 +61,7 @@ sitepackages = False
# Stricter in hacking 0.9: F402
# E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
ignore = E121,E122,E123,E124,E125,E129,E126,E127,E128,E131,E251,E265,E711,E712,E713,F402,H305,H307,H405,H803,H904
ignore = E121,E122,E123,E124,E125,E129,E126,E127,E128,E131,E251,E265,E711,E712,E713,F402,H405,H803,H904
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools
[hacking]