Corrected import order

Enabled H306 in tox.ini and corrected the import order.

Change-Id: If77984e8c62b0ec0cfb3d068e9c1b0d4d7c3583d
This commit is contained in:
Lianhao Lu 2013-10-28 11:53:19 +08:00
parent 4e9f5bf11d
commit 0e26faeb69
98 changed files with 244 additions and 224 deletions

View File

@ -25,12 +25,12 @@ import sys
from oslo.config import cfg
from ceilometer import sample
from ceilometer.openstack.common import context
from ceilometer.openstack.common import timeutils
from ceilometer import pipeline
from ceilometer import sample
from ceilometer import service
from ceilometer import transformer
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common import context
cfg.CONF.register_cli_opts([

View File

@ -18,14 +18,13 @@
import abc
import six
from oslo.config import cfg
from ceilometerclient import client as ceiloclient
from oslo.config import cfg
import six
from ceilometer.openstack.common import log
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
LOG = log.getLogger(__name__)

View File

@ -19,8 +19,8 @@
from ceilometer.alarm import evaluator
from ceilometer.alarm.evaluator import OK, ALARM, UNKNOWN
from ceilometer.openstack.common import log
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
LOG = log.getLogger(__name__)

View File

@ -22,9 +22,9 @@ import operator
from ceilometer.alarm import evaluator
from ceilometer.alarm.evaluator import OK, ALARM, UNKNOWN
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.gettextutils import _
LOG = log.getLogger(__name__)

View File

@ -21,9 +21,9 @@ import random
import uuid
from ceilometer.alarm import rpc as rpc_alarm
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.gettextutils import _
LOG = log.getLogger(__name__)

View File

@ -19,9 +19,9 @@
from oslo.config import cfg
from ceilometer.openstack.common import context
from ceilometer.openstack.common.rpc import proxy as rpc_proxy
from ceilometer.openstack.common import log
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer.openstack.common.rpc import proxy as rpc_proxy
from ceilometer.storage.models import Alarm
OPTS = [

View File

@ -19,22 +19,22 @@
# under the License.
import abc
import six
from ceilometerclient import client as ceiloclient
from oslo.config import cfg
import six
from stevedore import extension
from ceilometer.alarm import rpc as rpc_alarm
from ceilometer.alarm.partition import coordination
from ceilometer.service import prepare_service
from ceilometer.alarm import rpc as rpc_alarm
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import importutils
from ceilometer.openstack.common import log
from ceilometer.openstack.common import network_utils
from ceilometer.openstack.common import service as os_service
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common.rpc import service as rpc_service
from ceilometer.openstack.common.rpc import dispatcher as rpc_dispatcher
from ceilometerclient import client as ceiloclient
from ceilometer.openstack.common.rpc import service as rpc_service
from ceilometer.openstack.common import service as os_service
from ceilometer.service import prepare_service
OPTS = [

View File

@ -18,6 +18,8 @@
import logging
import os
from wsgiref import simple_server
from oslo.config import cfg
import pecan
@ -25,10 +27,9 @@ from ceilometer.api import acl
from ceilometer.api import config as api_config
from ceilometer.api import hooks
from ceilometer.api import middleware
from ceilometer.openstack.common import log
from ceilometer import service
from ceilometer import storage
from ceilometer.openstack.common import log
from wsgiref import simple_server
LOG = log.getLogger(__name__)

View File

@ -29,16 +29,16 @@ import datetime
import inspect
import json
import uuid
import pecan
import six
from pecan import rest
from oslo.config import cfg
import pecan
from pecan import rest
import six
import wsme
import wsmeext.pecan as wsme_pecan
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan
from ceilometer.api import acl
from ceilometer.openstack.common import context
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
@ -48,7 +48,6 @@ from ceilometer.openstack.common import timeutils
from ceilometer import sample
from ceilometer import storage
from ceilometer import utils
from ceilometer.api import acl
LOG = log.getLogger(__name__)

View File

@ -18,6 +18,7 @@
# under the License.
import threading
from oslo.config import cfg
from pecan import hooks

View File

@ -22,8 +22,8 @@ from stevedore import extension
from ceilometer import agent
from ceilometer.openstack.common import log
from ceilometer.openstack.common import service as os_service
from ceilometer.openstack.common.rpc import service as rpc_service
from ceilometer.openstack.common import service as os_service
from ceilometer import service
cfg.CONF.import_group('service_credentials', 'ceilometer.service')

View File

@ -16,12 +16,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from ceilometer import storage
from ceilometer.collector import dispatcher
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
from ceilometer.publisher import rpc as publisher_rpc
from ceilometer import storage
LOG = log.getLogger(__name__)

View File

@ -18,7 +18,9 @@
import logging
import logging.handlers
from oslo.config import cfg
from ceilometer.collector import dispatcher
file_dispatcher_opts = [

View File

@ -16,22 +16,22 @@
# License for the specific language governing permissions and limitations
# under the License.
import socket
import msgpack
from oslo.config import cfg
import socket
from stevedore import extension
from stevedore import named
from ceilometer.service import prepare_service
from ceilometer.openstack.common import context
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer.openstack.common import service as os_service
from ceilometer.openstack.common.rpc import dispatcher as rpc_dispatcher
from ceilometer.openstack.common.rpc import service as rpc_service
from ceilometer.openstack.common import service as os_service
from ceilometer.openstack.common import timeutils
from ceilometer import pipeline
from ceilometer.service import prepare_service
from ceilometer.storage import models
from ceilometer import transformer

View File

@ -23,8 +23,8 @@ from ceilometer import agent
from ceilometer.compute.virt import inspector as virt_inspector
from ceilometer import nova_client
from ceilometer.openstack.common import log
from ceilometer.openstack.common import service as os_service
from ceilometer.openstack.common.rpc import service as rpc_service
from ceilometer.openstack.common import service as os_service
from ceilometer import service
LOG = log.getLogger(__name__)

View File

@ -22,8 +22,8 @@
from oslo.config import cfg
from ceilometer import sample
from ceilometer import plugin
from ceilometer import sample
OPTS = [

View File

@ -19,8 +19,8 @@
import sys
from nova import notifications
from nova.openstack.common.notifier import api as notifier_api
from nova.openstack.common import log as logging
from nova.openstack.common.notifier import api as notifier_api
# HACK(dhellmann): Insert the nova version of openstack.common into
# sys.modules as though it was the copy from ceilometer, so that when

View File

@ -18,11 +18,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from ceilometer import sample
from ceilometer.compute import plugin
from ceilometer.compute.pollsters import util
from ceilometer.compute.virt import inspector as virt_inspector
from ceilometer.openstack.common import log
from ceilometer import sample
LOG = log.getLogger(__name__)

View File

@ -21,11 +21,11 @@
import abc
import collections
from ceilometer import sample
from ceilometer.compute import plugin
from ceilometer.compute.pollsters import util
from ceilometer.compute.virt import inspector as virt_inspector
from ceilometer.openstack.common import log
from ceilometer import sample
LOG = log.getLogger(__name__)

View File

@ -18,9 +18,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from ceilometer import sample
from ceilometer.compute import plugin
from ceilometer.compute.pollsters import util
from ceilometer import sample
class InstancePollster(plugin.ComputePollster):

View File

@ -20,12 +20,12 @@
import copy
from ceilometer import sample
from ceilometer.compute import plugin
from ceilometer.compute.pollsters import util
from ceilometer.compute.virt import inspector as virt_inspector
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
from ceilometer import sample
LOG = log.getLogger(__name__)

View File

@ -20,8 +20,8 @@
from oslo.config import cfg
from ceilometer import sample
from ceilometer.openstack.common import timeutils
from ceilometer import sample
INSTANCE_PROPERTIES = [

View File

@ -18,8 +18,8 @@
from oslo.config import cfg
from ceilometer.compute.virt import inspector as virt_inspector
from ceilometer.compute.virt.hyperv import utilsv2
from ceilometer.compute.virt import inspector as virt_inspector
from ceilometer.openstack.common import log
CONF = cfg.CONF

View File

@ -15,15 +15,15 @@
# under the License.
import datetime
from oslo.config import cfg
from keystoneclient import exceptions
from oslo.config import cfg
import requests
from ceilometer.central import plugin
from ceilometer import sample
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer import sample
LOG = log.getLogger(__name__)

View File

@ -19,14 +19,14 @@
"""
from __future__ import absolute_import
import itertools
import glanceclient
from oslo.config import cfg
from ceilometer import sample
from ceilometer.openstack.common import timeutils
from ceilometer import plugin
from ceilometer import sample
class _Base(plugin.PollsterBase):

View File

@ -21,8 +21,8 @@
from oslo.config import cfg
from ceilometer import sample
from ceilometer import plugin
from ceilometer import sample
OPTS = [
cfg.StrOpt('glance_control_exchange',

View File

@ -19,12 +19,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from ceilometer.central import plugin
from ceilometer import nova_client
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
from ceilometer.central import plugin
from ceilometer import sample
from ceilometer import nova_client
class FloatingIPPollster(plugin.CentralPollster):

View File

@ -22,9 +22,9 @@
from oslo.config import cfg
from ceilometer import sample
from ceilometer.openstack.common import log
from ceilometer import plugin
from ceilometer import sample
OPTS = [
cfg.StrOpt('neutron_control_exchange',

View File

@ -16,10 +16,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from ceilometer import pipeline
from ceilometer import transformer
from ceilometer.openstack.common import context as req_context
from ceilometer.openstack.common import log as logging
from ceilometer import pipeline
from ceilometer import transformer
from stevedore import extension

View File

@ -19,18 +19,17 @@
"""
from __future__ import absolute_import
from urlparse import urljoin
from keystoneclient import exceptions
from oslo.config import cfg
from swiftclient import client as swift
from keystoneclient import exceptions
from ceilometer import sample
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
from ceilometer import plugin
from urlparse import urljoin
from ceilometer import sample
LOG = log.getLogger(__name__)

View File

@ -55,10 +55,10 @@ except ImportError:
# Swift <= 1.7.5 ... module exists and has class.
from swift.common.middleware.proxy_logging import InputProxy
from ceilometer import sample
from ceilometer.openstack.common import context
from ceilometer.openstack.common import timeutils
from ceilometer import pipeline
from ceilometer import sample
from ceilometer import service
from ceilometer import transformer

View File

@ -18,8 +18,8 @@
import fnmatch
import itertools
import os
import operator
import os
from oslo.config import cfg
import yaml

View File

@ -19,9 +19,11 @@
# under the License.
import abc
from stevedore import driver
from ceilometer.openstack.common import network_utils
import six
from stevedore import driver
from ceilometer.openstack.common import network_utils
def get_publisher(url, namespace='ceilometer.publisher'):

View File

@ -20,8 +20,8 @@ import logging
import logging.handlers
import urlparse
from ceilometer import publisher
from ceilometer.openstack.common import log
from ceilometer import publisher
LOG = log.getLogger(__name__)

View File

@ -18,13 +18,15 @@
"""Publish a sample using an UDP mechanism
"""
from ceilometer import publisher
import socket
import msgpack
from oslo.config import cfg
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer.openstack.common import network_utils
from ceilometer.openstack.common.gettextutils import _
import msgpack
import socket
from oslo.config import cfg
from ceilometer import publisher
cfg.CONF.import_opt('udp_port', 'ceilometer.collector.service',
group='collector')

View File

@ -18,15 +18,14 @@
"""Storage backend management
"""
import urlparse
from oslo.config import cfg
from stevedore import driver
from ceilometer.openstack.common import log
from ceilometer import utils
from ceilometer import service
from ceilometer import utils
LOG = log.getLogger(__name__)

View File

@ -23,14 +23,14 @@
from __future__ import division
import copy
import weakref
import datetime
import itertools
import sys
import weakref
import bson.code
import bson.objectid
import datetime
import pymongo
import sys
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log

View File

@ -18,20 +18,21 @@
# under the License.
"""HBase storage backend
"""
import json
import hashlib
import itertools
import copy
import datetime
import happybase
import hashlib
import itertools
import json
import os
import re
import urlparse
import happybase
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common import network_utils
from ceilometer.openstack.common import timeutils
from ceilometer.storage import base
from ceilometer.storage import models

View File

@ -22,21 +22,21 @@
import calendar
import copy
import json
import operator
import weakref
import bson.code
import bson.objectid
import json
import pymongo
from oslo.config import cfg
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer import storage
from ceilometer.storage import base
from ceilometer.storage import models
from ceilometer.openstack.common.gettextutils import _
cfg.CONF.import_opt('time_to_live', 'ceilometer.storage',
group="database")

View File

@ -24,8 +24,8 @@ import os
import types
from sqlalchemy import and_
from sqlalchemy import func
from sqlalchemy import desc
from sqlalchemy import func
from sqlalchemy.orm import aliased
from ceilometer.openstack.common.db import exception as dbexc
@ -40,11 +40,11 @@ from ceilometer.storage.sqlalchemy.models import Alarm
from ceilometer.storage.sqlalchemy.models import AlarmChange
from ceilometer.storage.sqlalchemy.models import Base
from ceilometer.storage.sqlalchemy.models import Event
from ceilometer.storage.sqlalchemy.models import Meter
from ceilometer.storage.sqlalchemy.models import MetaBool
from ceilometer.storage.sqlalchemy.models import MetaFloat
from ceilometer.storage.sqlalchemy.models import MetaInt
from ceilometer.storage.sqlalchemy.models import MetaText
from ceilometer.storage.sqlalchemy.models import Meter
from ceilometer.storage.sqlalchemy.models import Project
from ceilometer.storage.sqlalchemy.models import Resource
from ceilometer.storage.sqlalchemy.models import Source

View File

@ -14,6 +14,7 @@
# under the License.
from sqlalchemy import Index
from ceilometer.storage.sqlalchemy.models import Meter

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import sqlalchemy
from migrate.changeset.constraint import UniqueConstraint
import sqlalchemy
from ceilometer.storage.sqlalchemy import models

View File

@ -17,6 +17,7 @@
# under the License.
import sqlalchemy as sa
from ceilometer.storage.sqlalchemy.models import PreciseTimestamp
_col = 'timestamp'

View File

@ -16,11 +16,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from sqlalchemy import String
from sqlalchemy import Text
from sqlalchemy import MetaData
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import Text
def upgrade(migrate_engine):

View File

@ -16,11 +16,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from sqlalchemy import String
from sqlalchemy import Text
from sqlalchemy import MetaData
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import Text
def upgrade(migrate_engine):

View File

@ -21,10 +21,10 @@ from sqlalchemy import Float
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy.sql import select
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import Text
from sqlalchemy.sql import select
from ceilometer import utils

View File

@ -24,10 +24,10 @@ import flask
import pecan
import pecan.testing
from ceilometer.openstack.common import jsonutils
from ceilometer.api import acl
from ceilometer.api.v1 import app as v1_app
from ceilometer.api.v1 import blueprint as v1_blueprint
from ceilometer.openstack.common import jsonutils
from ceilometer import service
from ceilometer.tests import db as db_test_base

View File

@ -20,6 +20,7 @@
"""
import functools
import os.path
from testtools import testcase
from ceilometer.openstack.common import test

View File

@ -20,12 +20,13 @@
"""Base classes for API tests."""
import os
import six
import uuid
import warnings
from ceilometer import storage
import six
from ceilometer.openstack.common.fixture import config
from ceilometer import storage
from ceilometer.tests import base as test_base

View File

@ -18,10 +18,10 @@
from collections import defaultdict
from ceilometer import sample
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
from ceilometer import sample
from ceilometer import transformer
LOG = log.getLogger(__name__)

View File

@ -21,8 +21,8 @@ events.
from oslo.config import cfg
from ceilometer import sample
from ceilometer import plugin
from ceilometer import sample
OPTS = [

View File

@ -21,17 +21,17 @@
import abc
import datetime
import mock
import mock
from stevedore import extension
from stevedore.tests import manager as extension_tests
from ceilometer import sample
from ceilometer import pipeline
from ceilometer import agent
from ceilometer import transformer
from ceilometer.openstack.common.fixture import config
from ceilometer import pipeline
from ceilometer import sample
from ceilometer.tests import base
from ceilometer import transformer
default_test_data = sample.Sample(

View File

@ -19,8 +19,8 @@
"""
import mock
from ceilometer.openstack.common import test
from ceilometer.alarm import evaluator
from ceilometer.openstack.common import test
class TestEvaluatorBaseClass(test.BaseTestCase):

View File

@ -18,13 +18,14 @@
"""Tests for ceilometer/alarm/partition/coordination.py
"""
import datetime
import mock
import uuid
import mock
from ceilometer.alarm.partition import coordination
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common import test
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.fixture import config
from ceilometer.storage import models

View File

@ -16,13 +16,14 @@
# License for the specific language governing permissions and limitations
# under the License.
import urlparse
import mock
import requests
from ceilometer.alarm import service
from ceilometer.openstack.common import context
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common import test
DATA_JSON = ('{"current": "ALARM", "alarm_id": "foobar",'

View File

@ -17,14 +17,15 @@
# under the License.
"""Tests for ceilometer.alarm.service.PartitionedAlarmService.
"""
import mock
from contextlib import nested
import mock
from stevedore import extension
from stevedore.tests import manager as extension_tests
from ceilometer.alarm import service
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common import test
class TestPartitionedAlarmService(test.BaseTestCase):

View File

@ -16,18 +16,18 @@
# License for the specific language governing permissions and limitations
# under the License.
import uuid
from ceilometerclient.v2.alarms import Alarm as AlarmClient
import mock
from ceilometer.alarm import rpc as rpc_alarm
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import rpc
from ceilometer.openstack.common import test
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.storage.models import Alarm as AlarmModel
from ceilometerclient.v2.alarms import Alarm as AlarmClient
class TestRPCAlarmNotifier(test.BaseTestCase):

View File

@ -19,12 +19,12 @@
"""
import os
from ceilometer.api.v1 import app
from ceilometer.api import acl
from ceilometer import service
from ceilometer.api.v1 import app
from ceilometer.openstack.common import fileutils
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common import test
from ceilometer import service
class TestApp(test.BaseTestCase):

View File

@ -20,10 +20,11 @@
import datetime
import logging
import testscenarios
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import timeutils
from ceilometer.storage import models
from ceilometer.tests import api as tests_api
from ceilometer.tests import db as tests_db

View File

@ -19,15 +19,15 @@
import datetime
import json
import testscenarios
from ceilometer import sample
from ceilometer.api import acl
from ceilometer.publisher import rpc
from ceilometer.tests import db as tests_db
from ceilometer.openstack.common import timeutils
from .base import FunctionalTest
from ceilometer.api import acl
from ceilometer.openstack.common import timeutils
from ceilometer.publisher import rpc
from ceilometer import sample
from ceilometer.tests import db as tests_db
load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -23,12 +23,12 @@
import datetime
import json as jsonutils
import logging
import mock
import uuid
import mock
import testscenarios
from .base import FunctionalTest
from ceilometer.storage.models import Alarm
from ceilometer.tests import db as tests_db

View File

@ -20,16 +20,16 @@
"""
import os
from ceilometer.api import app
from .base import FunctionalTest
from ceilometer.api import acl
from ceilometer import service
from ceilometer.api import app
from ceilometer.openstack.common import fileutils
from ceilometer.openstack.common import gettextutils
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import gettextutils
from ceilometer import service
from ceilometer.tests import base
from ceilometer.tests import db as tests_db
from .base import FunctionalTest
class TestApp(base.BaseTestCase):

View File

@ -20,13 +20,14 @@
import datetime
import logging
import testscenarios
from ceilometer.openstack.common import timeutils
from .base import FunctionalTest
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import timeutils
from ceilometer.storage import models
from ceilometer.tests import db as tests_db
from .base import FunctionalTest
load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -20,15 +20,15 @@
import datetime
import logging
import webtest.app
import testscenarios
import testscenarios
import webtest.app
from .base import FunctionalTest
from ceilometer.publisher import rpc
from ceilometer import sample
from ceilometer.tests import db as tests_db
from .base import FunctionalTest
load_tests = testscenarios.load_tests_apply_scenarios
LOG = logging.getLogger(__name__)

View File

@ -21,15 +21,15 @@
import copy
import datetime
import logging
import testscenarios
from .base import FunctionalTest
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import rpc
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.tests import db as tests_db
from .base import FunctionalTest
load_tests = testscenarios.load_tests_apply_scenarios
LOG = logging.getLogger(__name__)

View File

@ -15,16 +15,16 @@
# under the License.
"""Test the methods related to query."""
import datetime
import mock
import mock
import wsme
from ceilometer import storage
from ceilometer.api.controllers import v2 as api
from ceilometer.api.controllers.v2 import Query
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import test
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer import storage
from ceilometer.tests import base as tests_base

View File

@ -18,11 +18,12 @@
"""Test events statistics retrieval."""
import datetime
import testscenarios
from . import base
from ceilometer import sample
from ceilometer.publisher import rpc
from ceilometer import sample
from ceilometer.tests import db as tests_db
load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -18,12 +18,12 @@
"""Tests for ceilometer/central/manager.py
"""
import mock
from keystoneclient.v2_0 import client as ksclient
import mock
from ceilometer.central import manager
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import test
from tests import agentbase

View File

@ -19,10 +19,10 @@
"""
from datetime import datetime
from ceilometer.openstack.common import test
from ceilometer.collector.dispatcher import database
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.collector.dispatcher import database
from ceilometer.openstack.common import test
from ceilometer.publisher import rpc
from ceilometer.storage import base

View File

@ -18,13 +18,13 @@
"""Tests for ceilometer/collector/dispatcher/file.py
"""
import logging.handlers
import os
import tempfile
import logging.handlers
from ceilometer.collector.dispatcher import file
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common import test
from ceilometer.publisher import rpc

View File

@ -19,20 +19,20 @@
"""
import datetime
import msgpack
import socket
import mock
from mock import patch
from mock import MagicMock
import msgpack
from stevedore import extension
from stevedore.tests import manager as test_manager
from ceilometer import sample
from ceilometer.collector import service
from ceilometer.compute import notifications
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import timeutils
from ceilometer import sample
from ceilometer.storage import models
from ceilometer.tests import base as tests_base
@ -131,7 +131,7 @@ class TestUDPCollectorService(TestCollector):
).as_dict()
def test_udp_receive(self):
mock_dispatcher = MagicMock()
mock_dispatcher = mock.MagicMock()
self.srv.dispatcher_manager = test_manager.TestExtensionManager(
[extension.Extension('test',
None,
@ -152,7 +152,7 @@ class TestUDPCollectorService(TestCollector):
self.counter)
def test_udp_receive_storage_error(self):
mock_dispatcher = MagicMock()
mock_dispatcher = mock.MagicMock()
self.srv.dispatcher_manager = test_manager.TestExtensionManager(
[extension.Extension('test',
None,
@ -195,7 +195,7 @@ class TestCollectorService(TestCollector):
self.srv = service.CollectorService('the-host', 'the-topic')
self.ctx = None
@patch('ceilometer.pipeline.setup_pipeline', MagicMock())
@patch('ceilometer.pipeline.setup_pipeline', mock.MagicMock())
def test_init_host(self):
# If we try to create a real RPC connection, init_host() never
# returns. Mock it out so we can establish the service
@ -203,7 +203,7 @@ class TestCollectorService(TestCollector):
with patch('ceilometer.openstack.common.rpc.create_connection'):
self.srv.start()
@patch('ceilometer.pipeline.setup_pipeline', MagicMock())
@patch('ceilometer.pipeline.setup_pipeline', mock.MagicMock())
def test_process_notification(self):
# If we try to create a real RPC connection, init_host() never
# returns. Mock it out so we can establish the service
@ -211,7 +211,7 @@ class TestCollectorService(TestCollector):
self.CONF.set_override("store_events", False, group="collector")
with patch('ceilometer.openstack.common.rpc.create_connection'):
self.srv.start()
self.srv.pipeline_manager.pipelines[0] = MagicMock()
self.srv.pipeline_manager.pipelines[0] = mock.MagicMock()
self.srv.notification_manager = test_manager.TestExtensionManager(
[extension.Extension('test',
None,
@ -225,14 +225,14 @@ class TestCollectorService(TestCollector):
def test_process_notification_no_events(self):
self.CONF.set_override("store_events", False, group="collector")
self.srv.notification_manager = MagicMock()
self.srv.notification_manager = mock.MagicMock()
with patch.object(self.srv, '_message_to_event') as fake_msg_to_event:
self.srv.process_notification({})
self.assertFalse(fake_msg_to_event.called)
def test_process_notification_with_events(self):
self.CONF.set_override("store_events", True, group="collector")
self.srv.notification_manager = MagicMock()
self.srv.notification_manager = mock.MagicMock()
with patch.object(self.srv, '_message_to_event') as fake_msg_to_event:
self.srv.process_notification({})
self.assertTrue(fake_msg_to_event.called)
@ -244,7 +244,7 @@ class TestCollectorService(TestCollector):
'message_id': "abc",
'publisher_id': "1"}
mock_dispatcher = MagicMock()
mock_dispatcher = mock.MagicMock()
self.srv.dispatcher_manager = test_manager.TestExtensionManager(
[extension.Extension('test',
None,
@ -265,7 +265,7 @@ class TestCollectorService(TestCollector):
def test_message_to_event_duplicate(self):
self.CONF.set_override("store_events", True, group="collector")
mock_dispatcher = MagicMock()
mock_dispatcher = mock.MagicMock()
self.srv.dispatcher_manager = test_manager.TestExtensionManager(
[extension.Extension('test',
None,
@ -280,7 +280,7 @@ class TestCollectorService(TestCollector):
def test_message_to_event_bad_event(self):
self.CONF.set_override("store_events", True, group="collector")
mock_dispatcher = MagicMock()
mock_dispatcher = mock.MagicMock()
self.srv.dispatcher_manager = test_manager.TestExtensionManager(
[extension.Extension('test',
None,

View File

@ -22,9 +22,9 @@
import mock
from ceilometer.openstack.common import test
from ceilometer.compute import manager
from ceilometer.compute.pollsters import util
from ceilometer.openstack.common import test
class FauxInstance(object):

View File

@ -19,10 +19,10 @@
"""
import mock
from ceilometer import nova_client
from ceilometer.compute import manager
from ceilometer.openstack.common import test
from ceilometer import nova_client
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import test
from tests import agentbase

View File

@ -19,8 +19,8 @@ Tests for Hyper-V utilsv2.
import mock
from ceilometer.compute.virt import inspector
from ceilometer.compute.virt.hyperv import utilsv2 as utilsv2
from ceilometer.compute.virt import inspector
from ceilometer.openstack.common import test

View File

@ -19,12 +19,14 @@
"""Tests for libvirt inspector.
"""
from contextlib import nested
import fixtures
import mock
from ceilometer.compute.virt import inspector as virt_inspector
from ceilometer.compute.virt.libvirt import inspector as libvirt_inspector
import fixtures
from ceilometer.openstack.common import test
import mock
from contextlib import nested
class TestLibvirtInspection(test.BaseTestCase):

View File

@ -15,15 +15,16 @@
# under the License.
import datetime
import mock
from ceilometer.energy import kwapi
from ceilometer.central import manager
from ceilometer.openstack.common import context
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import moxstubout
from keystoneclient import exceptions
import mock
from ceilometer.central import manager
from ceilometer.energy import kwapi
from ceilometer.openstack.common import context
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import test
PROBE_DICT = {
"probes": {

View File

@ -18,11 +18,11 @@
import mock
from ceilometer.image import glance
from ceilometer.central import manager
from ceilometer.image import glance
from ceilometer.openstack.common import context
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import test
IMAGE_LIST = [
type('Image', (object,),

View File

@ -20,8 +20,8 @@
from datetime import datetime
from ceilometer.image import notifications
from ceilometer import sample
from ceilometer.openstack.common import test
from ceilometer import sample
def fake_uuid(x):

View File

@ -19,16 +19,15 @@
import collections
from keystoneclient import exceptions
import mock
from swiftclient import client as swift_client
import testscenarios
from ceilometer.central import manager
from ceilometer.objectstore import swift
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import moxstubout
from keystoneclient import exceptions
from swiftclient import client as swift_client
from ceilometer.openstack.common import test
load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -18,14 +18,14 @@
# under the License.
import cStringIO as StringIO
import mock
import mock
from webob import Request
from ceilometer.objectstore import swift_middleware
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import test
from ceilometer import pipeline

View File

@ -19,15 +19,15 @@
"""
import datetime
import os
import logging
import logging.handlers
import os
import tempfile
from ceilometer import sample
from ceilometer.publisher import file
from ceilometer.openstack.common import test
from ceilometer.openstack.common.network_utils import urlsplit
from ceilometer.openstack.common import test
from ceilometer.publisher import file
from ceilometer import sample
class TestFilePublisher(test.BaseTestCase):

View File

@ -18,19 +18,18 @@
# under the License.
"""Tests for ceilometer/publisher/rpc.py
"""
import datetime
import eventlet
import fixtures
import mock
from ceilometer import sample
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common import jsonutils
from ceilometer.openstack.common import network_utils
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import config
from ceilometer.publisher import rpc
from ceilometer import sample
class TestSignature(test.BaseTestCase):

View File

@ -19,15 +19,16 @@
"""
import datetime
import mock
import msgpack
from ceilometer import sample
from ceilometer.publisher import udp
from ceilometer.openstack.common import test
from ceilometer.openstack.common import network_utils
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import network_utils
from ceilometer.openstack.common import test
from ceilometer.publisher import udp
from ceilometer import sample
COUNTER_SOURCE = 'testsource'

View File

@ -19,12 +19,12 @@
from datetime import datetime
import mock
from sqlalchemy.types import DATETIME, NUMERIC
from sqlalchemy.dialects.mysql import DECIMAL
from sqlalchemy.types import DATETIME, NUMERIC
from ceilometer import utils
from ceilometer.openstack.common import test
from ceilometer.storage.sqlalchemy import models
from ceilometer import utils
class PreciseTimestampTest(test.BaseTestCase):

View File

@ -20,8 +20,8 @@
import mox
from ceilometer import storage
from ceilometer.openstack.common import test
from ceilometer import storage
from ceilometer.storage import impl_log

View File

@ -17,8 +17,9 @@
# under the License.
"""Tests for ceilometer/storage/impl_log.py
"""
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import test
from ceilometer.storage import impl_log

View File

@ -29,11 +29,10 @@ import datetime
from ceilometer.publisher import rpc
from ceilometer import sample
from ceilometer.storage import impl_mongodb
from ceilometer.storage.base import NoResultFound
from ceilometer.storage.base import MultipleResultsFound
from ceilometer.storage.base import NoResultFound
from ceilometer.storage import impl_mongodb
from ceilometer.tests import db as tests_db
from tests.storage import test_storage_scenarios

View File

@ -25,13 +25,14 @@
import datetime
import repr
from mock import patch
from ceilometer.storage import models
from ceilometer.storage.sqlalchemy.models import table_args
from ceilometer.storage.sqlalchemy import models as sql_models
from ceilometer import utils
from ceilometer.storage.sqlalchemy.models import table_args
from ceilometer.tests import db as tests_db
from ceilometer import utils
class EventTestBase(tests_db.TestBase):

View File

@ -20,15 +20,16 @@
"""
import datetime
import testscenarios
from ceilometer.publisher import rpc
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import timeutils
from ceilometer.publisher import rpc
from ceilometer import sample
from ceilometer import storage
from ceilometer.storage import models
from ceilometer.storage.base import Pagination
from ceilometer.storage import models
from ceilometer.tests import db as tests_db
load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -17,7 +17,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import httplib2
import json
import os
import random
@ -25,8 +24,10 @@ import socket
import subprocess
import time
from ceilometer.tests import base
import httplib2
from ceilometer.openstack.common import fileutils
from ceilometer.tests import base
class BinTestCase(base.BaseTestCase):

View File

@ -15,9 +15,10 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import config
from ceilometer import middleware
from ceilometer.openstack.common.fixture import config
from ceilometer.openstack.common import test
HTTP_REQUEST = {

View File

@ -19,9 +19,9 @@
"""
from ceilometer import notifier
from ceilometer.openstack.common import test
from ceilometer import pipeline
from ceilometer import transformer
from ceilometer.openstack.common import test
MESSAGE = {

View File

@ -18,11 +18,11 @@
# under the License.
import mock
import novaclient
from ceilometer import nova_client
from ceilometer.openstack.common import test
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import test
class TestNovaClient(test.BaseTestCase):

View File

@ -21,16 +21,16 @@ import datetime
from stevedore import extension
from ceilometer import sample
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer.openstack.common import test
from ceilometer.openstack.common import timeutils
from ceilometer import pipeline
from ceilometer import publisher
from ceilometer.publisher import test as test_publisher
from ceilometer import sample
from ceilometer import transformer
from ceilometer.transformer import accumulator
from ceilometer.transformer import conversions
from ceilometer.openstack.common import test
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.fixture import moxstubout
from ceilometer import pipeline
class TestTransformerAccumulator(test.BaseTestCase):

View File

@ -16,8 +16,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from ceilometer import plugin
from ceilometer.openstack.common import test
from ceilometer import plugin
TEST_NOTIFICATION = {

View File

@ -17,17 +17,19 @@
# License for the specific language governing permissions and limitations
# under the License.
import yaml
import subprocess
import os
import shutil
import signal
import time
import subprocess
import threading
from ceilometer import service
from ceilometer.tests import base
import time
import yaml
from ceilometer.openstack.common import fileutils
from ceilometer.openstack.common import test
from ceilometer import service
from ceilometer.tests import base
class ServiceTestCase(test.BaseTestCase):

View File

@ -19,8 +19,8 @@
# under the License.
"""Tests for ceilometer/utils.py
"""
import decimal
import datetime
import decimal
from ceilometer.openstack.common import test
from ceilometer import utils

View File

@ -45,7 +45,7 @@ deps = -r{toxinidir}/requirements.txt
commands = {posargs}
[flake8]
ignore = H301,H306,H506
ignore = H301,H506
builtins = _
exclude=.venv,.git,.tox,dist,doc,./ceilometer/openstack/common,*lib/python*,*egg,tools,nova_tests,build
show-source = True