From ee31a84719537ac18087bf6f6755928b2c81930d Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 21 Jan 2015 18:46:55 -0500 Subject: [PATCH] Update Oslo imports to remove namespace package Change-Id: I4ec9b2a310471e4e07867073e9577731ac34027d Blueprint: drop-namespace-packages --- oslo_messaging/_cmd/zmq_receiver.py | 3 ++- oslo_messaging/_drivers/amqp.py | 4 ++-- oslo_messaging/_drivers/common.py | 2 +- oslo_messaging/_drivers/impl_qpid.py | 8 ++++---- oslo_messaging/_drivers/impl_rabbit.py | 4 ++-- oslo_messaging/_drivers/impl_zmq.py | 8 ++++---- oslo_messaging/_drivers/matchmaker.py | 2 +- oslo_messaging/_drivers/matchmaker_redis.py | 5 +++-- oslo_messaging/_drivers/matchmaker_ring.py | 3 ++- oslo_messaging/_drivers/protocols/amqp/controller.py | 2 +- oslo_messaging/_drivers/protocols/amqp/driver.py | 2 +- oslo_messaging/_drivers/protocols/amqp/opts.py | 2 +- oslo_messaging/_executors/base.py | 3 +-- oslo_messaging/_executors/impl_eventlet.py | 2 +- oslo_messaging/_executors/impl_thread.py | 2 +- oslo_messaging/_i18n.py | 4 ++-- oslo_messaging/notify/_impl_log.py | 3 ++- oslo_messaging/notify/_impl_routing.py | 2 +- oslo_messaging/notify/listener.py | 2 +- oslo_messaging/notify/log_handler.py | 2 +- oslo_messaging/notify/logger.py | 3 ++- oslo_messaging/notify/middleware.py | 4 ++-- oslo_messaging/notify/notifier.py | 6 +++--- oslo_messaging/rpc/client.py | 2 +- oslo_messaging/rpc/server.py | 2 +- oslo_messaging/tests/drivers/test_impl_rabbit.py | 4 ++-- oslo_messaging/tests/drivers/test_impl_zmq.py | 2 +- oslo_messaging/tests/drivers/test_matchmaker.py | 2 +- oslo_messaging/tests/drivers/test_matchmaker_redis.py | 2 +- oslo_messaging/tests/drivers/test_matchmaker_ring.py | 2 +- oslo_messaging/tests/functional/utils.py | 2 +- oslo_messaging/tests/notify/test_dispatcher.py | 2 +- oslo_messaging/tests/notify/test_listener.py | 2 +- oslo_messaging/tests/notify/test_logger.py | 6 +++--- oslo_messaging/tests/notify/test_notifier.py | 10 +++++----- oslo_messaging/tests/rpc/test_client.py | 2 +- oslo_messaging/tests/rpc/test_server.py | 2 +- oslo_messaging/tests/test_amqp_driver.py | 2 +- oslo_messaging/tests/test_exception_serialization.py | 2 +- oslo_messaging/tests/test_transport.py | 2 +- oslo_messaging/tests/utils.py | 6 ++---- oslo_messaging/transport.py | 2 +- tests/notify/test_dispatcher.py | 2 +- tests/notify/test_logger.py | 6 +++--- tests/notify/test_notifier.py | 10 +++++----- 45 files changed, 77 insertions(+), 75 deletions(-) diff --git a/oslo_messaging/_cmd/zmq_receiver.py b/oslo_messaging/_cmd/zmq_receiver.py index 6346d6abc..cbcdfe88d 100644 --- a/oslo_messaging/_cmd/zmq_receiver.py +++ b/oslo_messaging/_cmd/zmq_receiver.py @@ -21,7 +21,8 @@ import contextlib import logging import sys -from oslo.config import cfg +from oslo_config import cfg + from oslo_messaging._drivers import impl_zmq from oslo_messaging._executors import base # FIXME(markmc) diff --git a/oslo_messaging/_drivers/amqp.py b/oslo_messaging/_drivers/amqp.py index 0648b1ef8..01ec055ea 100644 --- a/oslo_messaging/_drivers/amqp.py +++ b/oslo_messaging/_drivers/amqp.py @@ -27,10 +27,10 @@ import collections import logging import uuid +from oslo_config import cfg +from oslo_utils import strutils import six -from oslo.config import cfg -from oslo.utils import strutils from oslo_messaging._drivers import common as rpc_common from oslo_messaging._drivers import pool diff --git a/oslo_messaging/_drivers/common.py b/oslo_messaging/_drivers/common.py index 3b0247fba..c6e337bbe 100644 --- a/oslo_messaging/_drivers/common.py +++ b/oslo_messaging/_drivers/common.py @@ -21,9 +21,9 @@ import sys import time import traceback +from oslo_serialization import jsonutils import six -from oslo.serialization import jsonutils import oslo_messaging from oslo_messaging._i18n import _ from oslo_messaging import _utils as utils diff --git a/oslo_messaging/_drivers/impl_qpid.py b/oslo_messaging/_drivers/impl_qpid.py index 7bd527258..88d5930b1 100644 --- a/oslo_messaging/_drivers/impl_qpid.py +++ b/oslo_messaging/_drivers/impl_qpid.py @@ -20,12 +20,12 @@ import os import random import time +from oslo_config import cfg +from oslo_serialization import jsonutils +from oslo_utils import importutils +from oslo_utils import netutils import six -from oslo.config import cfg -from oslo.serialization import jsonutils -from oslo.utils import importutils -from oslo.utils import netutils from oslo_messaging._drivers import amqp as rpc_amqp from oslo_messaging._drivers import amqpdriver from oslo_messaging._drivers import common as rpc_common diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py index f7b932e3b..76332c9b3 100644 --- a/oslo_messaging/_drivers/impl_rabbit.py +++ b/oslo_messaging/_drivers/impl_rabbit.py @@ -26,11 +26,11 @@ import kombu.connection import kombu.entity import kombu.exceptions import kombu.messaging +from oslo_config import cfg +from oslo_utils import netutils import six from six.moves.urllib import parse -from oslo.config import cfg -from oslo.utils import netutils from oslo_messaging._drivers import amqp as rpc_amqp from oslo_messaging._drivers import amqpdriver from oslo_messaging._drivers import common as rpc_common diff --git a/oslo_messaging/_drivers/impl_zmq.py b/oslo_messaging/_drivers/impl_zmq.py index 678b3f5dd..f9cb473a4 100644 --- a/oslo_messaging/_drivers/impl_zmq.py +++ b/oslo_messaging/_drivers/impl_zmq.py @@ -25,17 +25,17 @@ import uuid import eventlet import greenlet +from oslo_config import cfg +from oslo_serialization import jsonutils +from oslo_utils import excutils +from oslo_utils import importutils import six from six import moves -from oslo.config import cfg from oslo_messaging._drivers import base from oslo_messaging._drivers import common as rpc_common from oslo_messaging._executors import base as executor_base # FIXME(markmc) from oslo_messaging._i18n import _, _LE -from oslo.serialization import jsonutils -from oslo.utils import excutils -from oslo.utils import importutils zmq = importutils.try_import('eventlet.green.zmq') diff --git a/oslo_messaging/_drivers/matchmaker.py b/oslo_messaging/_drivers/matchmaker.py index 0b3ba4b83..bea3f7f72 100644 --- a/oslo_messaging/_drivers/matchmaker.py +++ b/oslo_messaging/_drivers/matchmaker.py @@ -20,8 +20,8 @@ import contextlib import logging import eventlet +from oslo_config import cfg -from oslo.config import cfg from oslo_messaging._i18n import _ matchmaker_opts = [ diff --git a/oslo_messaging/_drivers/matchmaker_redis.py b/oslo_messaging/_drivers/matchmaker_redis.py index 760561d98..f77b755cf 100644 --- a/oslo_messaging/_drivers/matchmaker_redis.py +++ b/oslo_messaging/_drivers/matchmaker_redis.py @@ -16,8 +16,9 @@ The MatchMaker classes should accept a Topic or Fanout exchange key and return keys for direct exchanges, per (approximate) AMQP parlance. """ -from oslo.config import cfg -from oslo.utils import importutils +from oslo_config import cfg +from oslo_utils import importutils + from oslo_messaging._drivers import matchmaker as mm_common redis = importutils.try_import('redis') diff --git a/oslo_messaging/_drivers/matchmaker_ring.py b/oslo_messaging/_drivers/matchmaker_ring.py index 0b65875f7..0fd918cb5 100644 --- a/oslo_messaging/_drivers/matchmaker_ring.py +++ b/oslo_messaging/_drivers/matchmaker_ring.py @@ -20,7 +20,8 @@ import itertools import json import logging -from oslo.config import cfg +from oslo_config import cfg + from oslo_messaging._drivers import matchmaker as mm from oslo_messaging._i18n import _ diff --git a/oslo_messaging/_drivers/protocols/amqp/controller.py b/oslo_messaging/_drivers/protocols/amqp/controller.py index ea0950e6d..73f5cf112 100644 --- a/oslo_messaging/_drivers/protocols/amqp/controller.py +++ b/oslo_messaging/_drivers/protocols/amqp/controller.py @@ -29,11 +29,11 @@ import logging import threading import uuid +from oslo_config import cfg import proton import pyngus from six import moves -from oslo.config import cfg from oslo_messaging._drivers.protocols.amqp import eventloop from oslo_messaging._drivers.protocols.amqp import opts from oslo_messaging import transport diff --git a/oslo_messaging/_drivers/protocols/amqp/driver.py b/oslo_messaging/_drivers/protocols/amqp/driver.py index 8ec8b9e44..ba27f0ce5 100644 --- a/oslo_messaging/_drivers/protocols/amqp/driver.py +++ b/oslo_messaging/_drivers/protocols/amqp/driver.py @@ -25,10 +25,10 @@ import os import threading import time +from oslo_serialization import jsonutils import proton from six import moves -from oslo.serialization import jsonutils import oslo_messaging from oslo_messaging._drivers import base from oslo_messaging._drivers import common diff --git a/oslo_messaging/_drivers/protocols/amqp/opts.py b/oslo_messaging/_drivers/protocols/amqp/opts.py index 7aade7a9c..0eae3be1e 100644 --- a/oslo_messaging/_drivers/protocols/amqp/opts.py +++ b/oslo_messaging/_drivers/protocols/amqp/opts.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg +from oslo_config import cfg amqp1_opts = [ diff --git a/oslo_messaging/_executors/base.py b/oslo_messaging/_executors/base.py index d60d656e9..2cc667e27 100644 --- a/oslo_messaging/_executors/base.py +++ b/oslo_messaging/_executors/base.py @@ -14,10 +14,9 @@ import abc +from oslo_config import cfg import six -from oslo.config import cfg - _pool_opts = [ cfg.IntOpt('rpc_thread_pool_size', default=64, diff --git a/oslo_messaging/_executors/impl_eventlet.py b/oslo_messaging/_executors/impl_eventlet.py index 95d0a2f7d..555ae0364 100644 --- a/oslo_messaging/_executors/impl_eventlet.py +++ b/oslo_messaging/_executors/impl_eventlet.py @@ -20,8 +20,8 @@ import eventlet from eventlet.green import threading as greenthreading from eventlet import greenpool import greenlet +from oslo_utils import excutils -from oslo.utils import excutils from oslo_messaging._executors import base from oslo_messaging import localcontext diff --git a/oslo_messaging/_executors/impl_thread.py b/oslo_messaging/_executors/impl_thread.py index 2ed4560ba..ca8ebc790 100644 --- a/oslo_messaging/_executors/impl_thread.py +++ b/oslo_messaging/_executors/impl_thread.py @@ -20,9 +20,9 @@ import sys import threading from concurrent import futures +from oslo_utils import excutils import six -from oslo.utils import excutils from oslo_messaging._executors import base diff --git a/oslo_messaging/_i18n.py b/oslo_messaging/_i18n.py index c4a0e7ff6..a012b5866 100644 --- a/oslo_messaging/_i18n.py +++ b/oslo_messaging/_i18n.py @@ -16,10 +16,10 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html """ -from oslo import i18n +import oslo_i18n -_translators = i18n.TranslatorFactory(domain='oslo.messaging') +_translators = oslo_i18n.TranslatorFactory(domain='oslo.messaging') # The primary translation function using the well-known name "_" _ = _translators.primary diff --git a/oslo_messaging/notify/_impl_log.py b/oslo_messaging/notify/_impl_log.py index e04aa618d..400f556f5 100644 --- a/oslo_messaging/notify/_impl_log.py +++ b/oslo_messaging/notify/_impl_log.py @@ -17,7 +17,8 @@ import logging -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils + from oslo_messaging.notify import notifier diff --git a/oslo_messaging/notify/_impl_routing.py b/oslo_messaging/notify/_impl_routing.py index 666ad4de4..b42087059 100644 --- a/oslo_messaging/notify/_impl_routing.py +++ b/oslo_messaging/notify/_impl_routing.py @@ -16,11 +16,11 @@ import fnmatch import logging +from oslo_config import cfg import six from stevedore import dispatch import yaml -from oslo.config import cfg from oslo_messaging._i18n import _ from oslo_messaging.notify import notifier diff --git a/oslo_messaging/notify/listener.py b/oslo_messaging/notify/listener.py index a1586ddfb..7faf70222 100644 --- a/oslo_messaging/notify/listener.py +++ b/oslo_messaging/notify/listener.py @@ -40,7 +40,7 @@ and eventlet executors available. A simple example of a notification listener with multiple endpoints might be:: - from oslo.config import cfg + from oslo_config import cfg import oslo_messaging class NotificationEndpoint(object): diff --git a/oslo_messaging/notify/log_handler.py b/oslo_messaging/notify/log_handler.py index dbbc67f91..eb4b35c01 100644 --- a/oslo_messaging/notify/log_handler.py +++ b/oslo_messaging/notify/log_handler.py @@ -12,7 +12,7 @@ import logging -from oslo.config import cfg +from oslo_config import cfg class LoggingErrorNotificationHandler(logging.Handler): diff --git a/oslo_messaging/notify/logger.py b/oslo_messaging/notify/logger.py index eb8e4458b..4117c2c40 100644 --- a/oslo_messaging/notify/logger.py +++ b/oslo_messaging/notify/logger.py @@ -16,7 +16,8 @@ Driver for the Python logging package that sends log records as a notification. """ import logging -from oslo.config import cfg +from oslo_config import cfg + from oslo_messaging.notify import notifier from oslo_messaging import transport diff --git a/oslo_messaging/notify/middleware.py b/oslo_messaging/notify/middleware.py index 5529713c0..4297e2977 100644 --- a/oslo_messaging/notify/middleware.py +++ b/oslo_messaging/notify/middleware.py @@ -21,11 +21,11 @@ import os.path import sys import traceback as tb +from oslo_config import cfg +from oslo_middleware import base import six import webob.dec -from oslo.config import cfg -from oslo.middleware import base import oslo_messaging from oslo_messaging._i18n import _LE from oslo_messaging import notify diff --git a/oslo_messaging/notify/notifier.py b/oslo_messaging/notify/notifier.py index d4e1b7248..5565d720d 100644 --- a/oslo_messaging/notify/notifier.py +++ b/oslo_messaging/notify/notifier.py @@ -19,11 +19,11 @@ import abc import logging import uuid +from oslo_config import cfg +from oslo_utils import timeutils import six from stevedore import named -from oslo.config import cfg -from oslo.utils import timeutils from oslo_messaging import serializer as msg_serializer _notifier_opts = [ @@ -104,7 +104,7 @@ class Notifier(object): :param publisher_id: field in notifications sent, for example 'compute.host1' :type publisher_id: str - :param driver: a driver to lookup from oslo.messaging.notify.drivers + :param driver: a driver to lookup from oslo_messaging.notify.drivers :type driver: str :param topic: the topic which to send messages on :type topic: str diff --git a/oslo_messaging/rpc/client.py b/oslo_messaging/rpc/client.py index 8ac73a15e..3ea703456 100644 --- a/oslo_messaging/rpc/client.py +++ b/oslo_messaging/rpc/client.py @@ -23,9 +23,9 @@ __all__ = [ 'RemoteError', ] +from oslo_config import cfg import six -from oslo.config import cfg from oslo_messaging._drivers import base as driver_base from oslo_messaging import _utils as utils from oslo_messaging import exceptions diff --git a/oslo_messaging/rpc/server.py b/oslo_messaging/rpc/server.py index f1cbc1205..7f6295b6b 100644 --- a/oslo_messaging/rpc/server.py +++ b/oslo_messaging/rpc/server.py @@ -42,7 +42,7 @@ complete. A simple example of an RPC server with multiple endpoints might be:: - from oslo.config import cfg + from oslo_config import cfg import oslo_messaging class ServerControlEndpoint(object): diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py index 3aace8b81..51210da58 100644 --- a/oslo_messaging/tests/drivers/test_impl_rabbit.py +++ b/oslo_messaging/tests/drivers/test_impl_rabbit.py @@ -21,11 +21,11 @@ import uuid import fixtures import kombu import mock +from oslo_config import cfg +from oslo_serialization import jsonutils from oslotest import mockpatch import testscenarios -from oslo.config import cfg -from oslo.serialization import jsonutils import oslo_messaging from oslo_messaging._drivers import amqpdriver from oslo_messaging._drivers import common as driver_common diff --git a/oslo_messaging/tests/drivers/test_impl_zmq.py b/oslo_messaging/tests/drivers/test_impl_zmq.py index d3b03f646..6d287fab6 100644 --- a/oslo_messaging/tests/drivers/test_impl_zmq.py +++ b/oslo_messaging/tests/drivers/test_impl_zmq.py @@ -18,9 +18,9 @@ import socket import fixtures import mock +from oslo_utils import importutils import testtools -from oslo.utils import importutils import oslo_messaging from oslo_messaging.tests import utils as test_utils diff --git a/oslo_messaging/tests/drivers/test_matchmaker.py b/oslo_messaging/tests/drivers/test_matchmaker.py index 40608f4f5..61c37a92b 100644 --- a/oslo_messaging/tests/drivers/test_matchmaker.py +++ b/oslo_messaging/tests/drivers/test_matchmaker.py @@ -12,9 +12,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_utils import importutils import testtools -from oslo.utils import importutils from oslo_messaging.tests import utils as test_utils # NOTE(jamespage) matchmaker tied directly to eventlet diff --git a/oslo_messaging/tests/drivers/test_matchmaker_redis.py b/oslo_messaging/tests/drivers/test_matchmaker_redis.py index 19f6bc148..a0c4d7f43 100644 --- a/oslo_messaging/tests/drivers/test_matchmaker_redis.py +++ b/oslo_messaging/tests/drivers/test_matchmaker_redis.py @@ -12,9 +12,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_utils import importutils import testtools -from oslo.utils import importutils from oslo_messaging.tests import utils as test_utils redis = importutils.try_import('redis') diff --git a/oslo_messaging/tests/drivers/test_matchmaker_ring.py b/oslo_messaging/tests/drivers/test_matchmaker_ring.py index 48c5a65cc..5f156007a 100644 --- a/oslo_messaging/tests/drivers/test_matchmaker_ring.py +++ b/oslo_messaging/tests/drivers/test_matchmaker_ring.py @@ -12,9 +12,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_utils import importutils import testtools -from oslo.utils import importutils from oslo_messaging.tests import utils as test_utils # NOTE(jamespage) matchmaker tied directly to eventlet diff --git a/oslo_messaging/tests/functional/utils.py b/oslo_messaging/tests/functional/utils.py index bbdd11b78..bf46a01c9 100644 --- a/oslo_messaging/tests/functional/utils.py +++ b/oslo_messaging/tests/functional/utils.py @@ -17,9 +17,9 @@ import time import uuid import fixtures +from oslo_config import cfg from six import moves -from oslo.config import cfg import oslo_messaging from oslo_messaging.notify import notifier from oslo_messaging.tests import utils as test_utils diff --git a/oslo_messaging/tests/notify/test_dispatcher.py b/oslo_messaging/tests/notify/test_dispatcher.py index 029f737ec..fed631885 100644 --- a/oslo_messaging/tests/notify/test_dispatcher.py +++ b/oslo_messaging/tests/notify/test_dispatcher.py @@ -16,9 +16,9 @@ import itertools import mock +from oslo_utils import timeutils import testscenarios -from oslo.utils import timeutils import oslo_messaging from oslo_messaging.notify import dispatcher as notify_dispatcher from oslo_messaging.tests import utils as test_utils diff --git a/oslo_messaging/tests/notify/test_listener.py b/oslo_messaging/tests/notify/test_listener.py index 3c1e40490..0bd032c52 100644 --- a/oslo_messaging/tests/notify/test_listener.py +++ b/oslo_messaging/tests/notify/test_listener.py @@ -17,9 +17,9 @@ import threading import time import mock +from oslo_config import cfg import testscenarios -from oslo.config import cfg import oslo_messaging from oslo_messaging.notify import dispatcher from oslo_messaging.tests import utils as test_utils diff --git a/oslo_messaging/tests/notify/test_logger.py b/oslo_messaging/tests/notify/test_logger.py index c551493da..693249b28 100644 --- a/oslo_messaging/tests/notify/test_logger.py +++ b/oslo_messaging/tests/notify/test_logger.py @@ -19,10 +19,10 @@ import os import sys import mock +from oslo_utils import timeutils import testscenarios import testtools -from oslo.utils import timeutils import oslo_messaging from oslo_messaging.tests.notify import test_notifier from oslo_messaging.tests import utils as test_utils @@ -56,7 +56,7 @@ class TestLogNotifier(test_utils.BaseTestCase): # eventlet logging.logThreads = 0 - @mock.patch('oslo.utils.timeutils.utcnow') + @mock.patch('oslo_utils.timeutils.utcnow') def test_logger(self, mock_utcnow): with mock.patch('oslo_messaging.transport.get_transport', return_value=test_notifier._FakeTransport(self.conf)): @@ -99,7 +99,7 @@ class TestLogNotifier(test_utils.BaseTestCase): @testtools.skipUnless(hasattr(logging.config, 'dictConfig'), "Need logging.config.dictConfig (Python >= 2.7)") - @mock.patch('oslo.utils.timeutils.utcnow') + @mock.patch('oslo_utils.timeutils.utcnow') def test_logging_conf(self, mock_utcnow): with mock.patch('oslo_messaging.transport.get_transport', return_value=test_notifier._FakeTransport(self.conf)): diff --git a/oslo_messaging/tests/notify/test_notifier.py b/oslo_messaging/tests/notify/test_notifier.py index 6b94d15e9..a8733f7d3 100644 --- a/oslo_messaging/tests/notify/test_notifier.py +++ b/oslo_messaging/tests/notify/test_notifier.py @@ -20,13 +20,13 @@ import uuid import fixtures import mock +from oslo_serialization import jsonutils +from oslo_utils import timeutils from stevedore import dispatch from stevedore import extension import testscenarios import yaml -from oslo.serialization import jsonutils -from oslo.utils import timeutils import oslo_messaging from oslo_messaging.notify import _impl_log from oslo_messaging.notify import _impl_messaging @@ -147,7 +147,7 @@ class TestMessagingNotifier(test_utils.BaseTestCase): self.stubs.Set(_impl_messaging, 'LOG', self.logger) self.stubs.Set(msg_notifier, '_LOG', self.logger) - @mock.patch('oslo.utils.timeutils.utcnow') + @mock.patch('oslo_utils.timeutils.utcnow') def test_notifier(self, mock_utcnow): drivers = [] if self.v1: @@ -223,7 +223,7 @@ class TestSerializer(test_utils.BaseTestCase): super(TestSerializer, self).setUp() self.addCleanup(_impl_test.reset) - @mock.patch('oslo.utils.timeutils.utcnow') + @mock.patch('oslo_utils.timeutils.utcnow') def test_serializer(self, mock_utcnow): transport = _FakeTransport(self.conf) @@ -266,7 +266,7 @@ class TestSerializer(test_utils.BaseTestCase): class TestLogNotifier(test_utils.BaseTestCase): - @mock.patch('oslo.utils.timeutils.utcnow') + @mock.patch('oslo_utils.timeutils.utcnow') def test_notifier(self, mock_utcnow): self.config(notification_driver=['log']) diff --git a/oslo_messaging/tests/rpc/test_client.py b/oslo_messaging/tests/rpc/test_client.py index 2276e6b48..e163a9297 100644 --- a/oslo_messaging/tests/rpc/test_client.py +++ b/oslo_messaging/tests/rpc/test_client.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_config import cfg import testscenarios -from oslo.config import cfg import oslo_messaging from oslo_messaging import exceptions from oslo_messaging import serializer as msg_serializer diff --git a/oslo_messaging/tests/rpc/test_server.py b/oslo_messaging/tests/rpc/test_server.py index 3970b95a4..7b140851e 100644 --- a/oslo_messaging/tests/rpc/test_server.py +++ b/oslo_messaging/tests/rpc/test_server.py @@ -16,9 +16,9 @@ import threading import mock +from oslo_config import cfg import testscenarios -from oslo.config import cfg import oslo_messaging from oslo_messaging.tests import utils as test_utils diff --git a/oslo_messaging/tests/test_amqp_driver.py b/oslo_messaging/tests/test_amqp_driver.py index 213a83216..a1f5ea595 100644 --- a/oslo_messaging/tests/test_amqp_driver.py +++ b/oslo_messaging/tests/test_amqp_driver.py @@ -20,10 +20,10 @@ import threading import time import uuid +from oslo_utils import importutils from six import moves import testtools -from oslo.utils import importutils import oslo_messaging from oslo_messaging.tests import utils as test_utils diff --git a/oslo_messaging/tests/test_exception_serialization.py b/oslo_messaging/tests/test_exception_serialization.py index 1d1de3173..c1079c0a4 100644 --- a/oslo_messaging/tests/test_exception_serialization.py +++ b/oslo_messaging/tests/test_exception_serialization.py @@ -15,10 +15,10 @@ import sys +from oslo_serialization import jsonutils import six import testscenarios -from oslo.serialization import jsonutils import oslo_messaging from oslo_messaging._drivers import common as exceptions from oslo_messaging.tests import utils as test_utils diff --git a/oslo_messaging/tests/test_transport.py b/oslo_messaging/tests/test_transport.py index 53d991a88..a09953afe 100644 --- a/oslo_messaging/tests/test_transport.py +++ b/oslo_messaging/tests/test_transport.py @@ -14,12 +14,12 @@ # under the License. import fixtures +from oslo_config import cfg import six from six.moves import mox from stevedore import driver import testscenarios -from oslo.config import cfg import oslo_messaging from oslo_messaging.tests import utils as test_utils from oslo_messaging import transport diff --git a/oslo_messaging/tests/utils.py b/oslo_messaging/tests/utils.py index f1b44a60e..bfa73a8c3 100644 --- a/oslo_messaging/tests/utils.py +++ b/oslo_messaging/tests/utils.py @@ -19,12 +19,10 @@ """Common utilities used in testing""" -import six - -from oslo.config import cfg - +from oslo_config import cfg from oslotest import base from oslotest import moxstubout +import six TRUE_VALUES = ('true', '1', 'yes') diff --git a/oslo_messaging/transport.py b/oslo_messaging/transport.py index 181cacb4a..5a8c3891a 100644 --- a/oslo_messaging/transport.py +++ b/oslo_messaging/transport.py @@ -27,11 +27,11 @@ __all__ = [ 'set_transport_defaults', ] +from oslo_config import cfg import six from six.moves.urllib import parse from stevedore import driver -from oslo.config import cfg from oslo_messaging import exceptions diff --git a/tests/notify/test_dispatcher.py b/tests/notify/test_dispatcher.py index f2e32ac48..adb861008 100644 --- a/tests/notify/test_dispatcher.py +++ b/tests/notify/test_dispatcher.py @@ -16,11 +16,11 @@ import itertools import mock +from oslo_utils import timeutils import testscenarios from oslo import messaging from oslo.messaging.notify import dispatcher as notify_dispatcher -from oslo.utils import timeutils from oslo_messaging.tests import utils as test_utils load_tests = testscenarios.load_tests_apply_scenarios diff --git a/tests/notify/test_logger.py b/tests/notify/test_logger.py index 1f770bded..6d1757a4d 100644 --- a/tests/notify/test_logger.py +++ b/tests/notify/test_logger.py @@ -19,11 +19,11 @@ import os import sys import mock +from oslo_utils import timeutils import testscenarios import testtools from oslo import messaging -from oslo.utils import timeutils import oslo_messaging from oslo_messaging.tests.notify import test_notifier from oslo_messaging.tests import utils as test_utils @@ -57,7 +57,7 @@ class TestLogNotifier(test_utils.BaseTestCase): # eventlet logging.logThreads = 0 - @mock.patch('oslo.utils.timeutils.utcnow') + @mock.patch('oslo_utils.timeutils.utcnow') def test_logger(self, mock_utcnow): with mock.patch('oslo_messaging.transport.get_transport', return_value=test_notifier._FakeTransport(self.conf)): @@ -100,7 +100,7 @@ class TestLogNotifier(test_utils.BaseTestCase): @testtools.skipUnless(hasattr(logging.config, 'dictConfig'), "Need logging.config.dictConfig (Python >= 2.7)") - @mock.patch('oslo.utils.timeutils.utcnow') + @mock.patch('oslo_utils.timeutils.utcnow') def test_logging_conf(self, mock_utcnow): with mock.patch('oslo_messaging.transport.get_transport', return_value=test_notifier._FakeTransport(self.conf)): diff --git a/tests/notify/test_notifier.py b/tests/notify/test_notifier.py index e7306a714..e326ad89f 100644 --- a/tests/notify/test_notifier.py +++ b/tests/notify/test_notifier.py @@ -20,6 +20,8 @@ import uuid import fixtures import mock +from oslo_serialization import jsonutils +from oslo_utils import timeutils from stevedore import dispatch from stevedore import extension import testscenarios @@ -27,8 +29,6 @@ import yaml from oslo import messaging from oslo.messaging import serializer as msg_serializer -from oslo.serialization import jsonutils -from oslo.utils import timeutils from oslo_messaging.notify import _impl_log from oslo_messaging.notify import _impl_messaging from oslo_messaging.notify import _impl_test @@ -147,7 +147,7 @@ class TestMessagingNotifier(test_utils.BaseTestCase): self.stubs.Set(_impl_messaging, 'LOG', self.logger) self.stubs.Set(msg_notifier, '_LOG', self.logger) - @mock.patch('oslo.utils.timeutils.utcnow') + @mock.patch('oslo_utils.timeutils.utcnow') def test_notifier(self, mock_utcnow): drivers = [] if self.v1: @@ -223,7 +223,7 @@ class TestSerializer(test_utils.BaseTestCase): super(TestSerializer, self).setUp() self.addCleanup(_impl_test.reset) - @mock.patch('oslo.utils.timeutils.utcnow') + @mock.patch('oslo_utils.timeutils.utcnow') def test_serializer(self, mock_utcnow): transport = _FakeTransport(self.conf) @@ -266,7 +266,7 @@ class TestSerializer(test_utils.BaseTestCase): class TestLogNotifier(test_utils.BaseTestCase): - @mock.patch('oslo.utils.timeutils.utcnow') + @mock.patch('oslo_utils.timeutils.utcnow') def test_notifier(self, mock_utcnow): self.config(notification_driver=['log'])