Browse Source

Update Oslo imports to remove namespace package

Change-Id: I4ec9b2a310471e4e07867073e9577731ac34027d
Blueprint: drop-namespace-packages
changes/97/149097/2
Doug Hellmann 6 years ago
parent
commit
ee31a84719
45 changed files with 77 additions and 75 deletions
  1. +2
    -1
      oslo_messaging/_cmd/zmq_receiver.py
  2. +2
    -2
      oslo_messaging/_drivers/amqp.py
  3. +1
    -1
      oslo_messaging/_drivers/common.py
  4. +4
    -4
      oslo_messaging/_drivers/impl_qpid.py
  5. +2
    -2
      oslo_messaging/_drivers/impl_rabbit.py
  6. +4
    -4
      oslo_messaging/_drivers/impl_zmq.py
  7. +1
    -1
      oslo_messaging/_drivers/matchmaker.py
  8. +3
    -2
      oslo_messaging/_drivers/matchmaker_redis.py
  9. +2
    -1
      oslo_messaging/_drivers/matchmaker_ring.py
  10. +1
    -1
      oslo_messaging/_drivers/protocols/amqp/controller.py
  11. +1
    -1
      oslo_messaging/_drivers/protocols/amqp/driver.py
  12. +1
    -1
      oslo_messaging/_drivers/protocols/amqp/opts.py
  13. +1
    -2
      oslo_messaging/_executors/base.py
  14. +1
    -1
      oslo_messaging/_executors/impl_eventlet.py
  15. +1
    -1
      oslo_messaging/_executors/impl_thread.py
  16. +2
    -2
      oslo_messaging/_i18n.py
  17. +2
    -1
      oslo_messaging/notify/_impl_log.py
  18. +1
    -1
      oslo_messaging/notify/_impl_routing.py
  19. +1
    -1
      oslo_messaging/notify/listener.py
  20. +1
    -1
      oslo_messaging/notify/log_handler.py
  21. +2
    -1
      oslo_messaging/notify/logger.py
  22. +2
    -2
      oslo_messaging/notify/middleware.py
  23. +3
    -3
      oslo_messaging/notify/notifier.py
  24. +1
    -1
      oslo_messaging/rpc/client.py
  25. +1
    -1
      oslo_messaging/rpc/server.py
  26. +2
    -2
      oslo_messaging/tests/drivers/test_impl_rabbit.py
  27. +1
    -1
      oslo_messaging/tests/drivers/test_impl_zmq.py
  28. +1
    -1
      oslo_messaging/tests/drivers/test_matchmaker.py
  29. +1
    -1
      oslo_messaging/tests/drivers/test_matchmaker_redis.py
  30. +1
    -1
      oslo_messaging/tests/drivers/test_matchmaker_ring.py
  31. +1
    -1
      oslo_messaging/tests/functional/utils.py
  32. +1
    -1
      oslo_messaging/tests/notify/test_dispatcher.py
  33. +1
    -1
      oslo_messaging/tests/notify/test_listener.py
  34. +3
    -3
      oslo_messaging/tests/notify/test_logger.py
  35. +5
    -5
      oslo_messaging/tests/notify/test_notifier.py
  36. +1
    -1
      oslo_messaging/tests/rpc/test_client.py
  37. +1
    -1
      oslo_messaging/tests/rpc/test_server.py
  38. +1
    -1
      oslo_messaging/tests/test_amqp_driver.py
  39. +1
    -1
      oslo_messaging/tests/test_exception_serialization.py
  40. +1
    -1
      oslo_messaging/tests/test_transport.py
  41. +2
    -4
      oslo_messaging/tests/utils.py
  42. +1
    -1
      oslo_messaging/transport.py
  43. +1
    -1
      tests/notify/test_dispatcher.py
  44. +3
    -3
      tests/notify/test_logger.py
  45. +5
    -5
      tests/notify/test_notifier.py

+ 2
- 1
oslo_messaging/_cmd/zmq_receiver.py View File

@ -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)


+ 2
- 2
oslo_messaging/_drivers/amqp.py View File

@ -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


+ 1
- 1
oslo_messaging/_drivers/common.py View File

@ -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


+ 4
- 4
oslo_messaging/_drivers/impl_qpid.py View File

@ -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


+ 2
- 2
oslo_messaging/_drivers/impl_rabbit.py View File

@ -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


+ 4
- 4
oslo_messaging/_drivers/impl_zmq.py View File

@ -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')


+ 1
- 1
oslo_messaging/_drivers/matchmaker.py View File

@ -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 = [


+ 3
- 2
oslo_messaging/_drivers/matchmaker_redis.py View File

@ -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')


+ 2
- 1
oslo_messaging/_drivers/matchmaker_ring.py View File

@ -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 _


+ 1
- 1
oslo_messaging/_drivers/protocols/amqp/controller.py View File

@ -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


+ 1
- 1
oslo_messaging/_drivers/protocols/amqp/driver.py View File

@ -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


+ 1
- 1
oslo_messaging/_drivers/protocols/amqp/opts.py View File

@ -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 = [


+ 1
- 2
oslo_messaging/_executors/base.py View File

@ -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,


+ 1
- 1
oslo_messaging/_executors/impl_eventlet.py View File

@ -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


+ 1
- 1
oslo_messaging/_executors/impl_thread.py View File

@ -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


+ 2
- 2
oslo_messaging/_i18n.py View File

@ -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


+ 2
- 1
oslo_messaging/notify/_impl_log.py View File

@ -17,7 +17,8 @@
import logging
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
from oslo_messaging.notify import notifier


+ 1
- 1
oslo_messaging/notify/_impl_routing.py View File

@ -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


+ 1
- 1
oslo_messaging/notify/listener.py View File

@ -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):


+ 1
- 1
oslo_messaging/notify/log_handler.py View File

@ -12,7 +12,7 @@
import logging
from oslo.config import cfg
from oslo_config import cfg
class LoggingErrorNotificationHandler(logging.Handler):


+ 2
- 1
oslo_messaging/notify/logger.py View File

@ -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


+ 2
- 2
oslo_messaging/notify/middleware.py View File

@ -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


+ 3
- 3
oslo_messaging/notify/notifier.py View File

@ -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


+ 1
- 1
oslo_messaging/rpc/client.py View File

@ -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


+ 1
- 1
oslo_messaging/rpc/server.py View File

@ -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):


+ 2
- 2
oslo_messaging/tests/drivers/test_impl_rabbit.py View File

@ -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


+ 1
- 1
oslo_messaging/tests/drivers/test_impl_zmq.py View File

@ -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


+ 1
- 1
oslo_messaging/tests/drivers/test_matchmaker.py View File

@ -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


+ 1
- 1
oslo_messaging/tests/drivers/test_matchmaker_redis.py View File

@ -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')


+ 1
- 1
oslo_messaging/tests/drivers/test_matchmaker_ring.py View File

@ -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


+ 1
- 1
oslo_messaging/tests/functional/utils.py View File

@ -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


+ 1
- 1
oslo_messaging/tests/notify/test_dispatcher.py View File

@ -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


+ 1
- 1
oslo_messaging/tests/notify/test_listener.py View File

@ -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


+ 3
- 3
oslo_messaging/tests/notify/test_logger.py View File

@ -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)):


+ 5
- 5
oslo_messaging/tests/notify/test_notifier.py View File

@ -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'])


+ 1
- 1
oslo_messaging/tests/rpc/test_client.py View File

@ -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


+ 1
- 1
oslo_messaging/tests/rpc/test_server.py View File

@ -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


+ 1
- 1
oslo_messaging/tests/test_amqp_driver.py View File

@ -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


+ 1
- 1
oslo_messaging/tests/test_exception_serialization.py View File

@ -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


+ 1
- 1
oslo_messaging/tests/test_transport.py View File

@ -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


+ 2
- 4
oslo_messaging/tests/utils.py View File

@ -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')


+ 1
- 1
oslo_messaging/transport.py View File

@ -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


+ 1
- 1
tests/notify/test_dispatcher.py View File

@ -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


+ 3
- 3
tests/notify/test_logger.py View File

@ -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)):


+ 5
- 5
tests/notify/test_notifier.py View File

@ -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'])


Loading…
Cancel
Save