From bb69046db59d93e21e5d006e7f580bf052ce357c Mon Sep 17 00:00:00 2001 From: Doug Hellmann <doug@doughellmann.com> Date: Tue, 28 Apr 2015 19:47:04 +0000 Subject: [PATCH] Drop use of 'oslo' namespace package The Oslo libraries have moved all of their code out of the 'oslo' namespace package into per-library packages. The namespace package was retained during kilo for backwards compatibility, but will be removed by the liberty-2 milestone. This change removes the use of the namespace package, replacing it with the new package names. The patches in the libraries will be put on hold until application patches have landed, or L2, whichever comes first. At that point, new versions of the libraries without namespace packages will be released as a major version update. Please merge this patch, or an equivalent, before L2 to avoid problems with those library releases. Blueprint: remove-namespace-packages https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages Change-Id: I75e6e15d50ef9830d0581efd4cbcceb3e626f7b7 --- manila/manager.py | 2 +- manila/rpc.py | 2 +- manila/scheduler/rpcapi.py | 2 +- manila/service.py | 2 +- manila/share/rpcapi.py | 2 +- manila/tests/fake_notifier.py | 2 +- manila/tests/share/test_api.py | 6 ------ manila/tests/test_test.py | 2 +- 8 files changed, 7 insertions(+), 13 deletions(-) diff --git a/manila/manager.py b/manila/manager.py index 766efb1a86..ce8104c3e2 100644 --- a/manila/manager.py +++ b/manila/manager.py @@ -140,7 +140,7 @@ class Manager(base.Base): https://wiki.openstack.org/wiki/Oslo/Messaging#API_Version_Negotiation """ if not hasattr(self, '_target'): - from oslo import messaging + import oslo_messaging as messaging self._target = messaging.Target(version=self.RPC_API_VERSION) return self._target diff --git a/manila/rpc.py b/manila/rpc.py index 3d61489f3d..5d3d30704d 100644 --- a/manila/rpc.py +++ b/manila/rpc.py @@ -26,8 +26,8 @@ __all__ = [ 'TRANSPORT_ALIASES', ] -from oslo import messaging from oslo_config import cfg +import oslo_messaging as messaging from oslo_serialization import jsonutils import manila.context diff --git a/manila/scheduler/rpcapi.py b/manila/scheduler/rpcapi.py index f983830854..81e3b61283 100644 --- a/manila/scheduler/rpcapi.py +++ b/manila/scheduler/rpcapi.py @@ -16,8 +16,8 @@ Client side of the scheduler manager RPC API. """ -from oslo import messaging from oslo_config import cfg +import oslo_messaging as messaging from oslo_serialization import jsonutils from manila import rpc diff --git a/manila/service.py b/manila/service.py index 8da9c8803e..c1e890f6a5 100644 --- a/manila/service.py +++ b/manila/service.py @@ -27,9 +27,9 @@ import time import eventlet import greenlet -from oslo import messaging from oslo_config import cfg from oslo_log import log +import oslo_messaging as messaging from oslo_utils import importutils from manila import context diff --git a/manila/share/rpcapi.py b/manila/share/rpcapi.py index adcd8efee7..83afea3f94 100644 --- a/manila/share/rpcapi.py +++ b/manila/share/rpcapi.py @@ -16,8 +16,8 @@ Client side of the share RPC API. """ -from oslo import messaging from oslo_config import cfg +import oslo_messaging as messaging from oslo_serialization import jsonutils from manila import rpc diff --git a/manila/tests/fake_notifier.py b/manila/tests/fake_notifier.py index 78c039bd83..8ce1fadf06 100644 --- a/manila/tests/fake_notifier.py +++ b/manila/tests/fake_notifier.py @@ -15,7 +15,7 @@ import collections import functools -from oslo import messaging +import oslo_messaging as messaging from oslo_serialization import jsonutils from manila import rpc diff --git a/manila/tests/share/test_api.py b/manila/tests/share/test_api.py index 483715e1d6..0295749978 100644 --- a/manila/tests/share/test_api.py +++ b/manila/tests/share/test_api.py @@ -20,10 +20,6 @@ import uuid import ddt import mock -# NOTE(vponomaryov): import from oslo.utils.timeutils is workaround for -# mocking same object but from different namespaces. Remove it when all -# oslo libs use same namespace for same things. -from oslo.utils import timeutils as timeutils_old # noqa from oslo_config import cfg from oslo_utils import timeutils @@ -182,8 +178,6 @@ class ShareAPITestCase(test.TestCase): dt_utc = datetime.datetime.utcnow() self.mock_object(timeutils, 'utcnow', mock.Mock(return_value=dt_utc)) - self.mock_object(timeutils_old, 'utcnow', - mock.Mock(return_value=dt_utc)) self.mock_object(share_api.policy, 'check_policy') def test_get_all_admin_no_filters(self): diff --git a/manila/tests/test_test.py b/manila/tests/test_test.py index 56daab7d78..8e9a4b7129 100644 --- a/manila/tests/test_test.py +++ b/manila/tests/test_test.py @@ -16,8 +16,8 @@ """Tests for the testing base code.""" -from oslo import messaging from oslo_config import cfg +import oslo_messaging as messaging from manila import rpc from manila import test