From 1e4cd8cb55b1c758d2f8b77af5fd4a57e7be8af9 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Tue, 28 Apr 2015 15:32:02 +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: I4e1cb4f1caaee61683dc9fb0ffc67e8f9e06dc6d --- .../openstack/common/eventlet_backdoor.py | 2 +- barbican/openstack/common/fileutils.py | 2 +- barbican/openstack/common/service.py | 2 +- barbican/openstack/common/sslutils.py | 2 +- barbican/plugin/snakeoil_ca.py | 2 +- barbican/queue/keystone_listener.py | 20 ++++++++++--------- barbican/tests/plugin/test_snakeoil_ca.py | 2 +- .../tests/queue/test_keystone_listener.py | 12 +++++------ 8 files changed, 23 insertions(+), 21 deletions(-) diff --git a/barbican/openstack/common/eventlet_backdoor.py b/barbican/openstack/common/eventlet_backdoor.py index f4fb09b49..f0da99729 100644 --- a/barbican/openstack/common/eventlet_backdoor.py +++ b/barbican/openstack/common/eventlet_backdoor.py @@ -28,7 +28,7 @@ import traceback import eventlet.backdoor import greenlet -from oslo.config import cfg +from oslo_config import cfg from barbican.openstack.common._i18n import _LI diff --git a/barbican/openstack/common/fileutils.py b/barbican/openstack/common/fileutils.py index 6cacf22b2..9097c35d4 100644 --- a/barbican/openstack/common/fileutils.py +++ b/barbican/openstack/common/fileutils.py @@ -20,7 +20,7 @@ import os import stat import tempfile -from oslo.utils import excutils +from oslo_utils import excutils LOG = logging.getLogger(__name__) diff --git a/barbican/openstack/common/service.py b/barbican/openstack/common/service.py index 80325b663..c41338720 100644 --- a/barbican/openstack/common/service.py +++ b/barbican/openstack/common/service.py @@ -35,7 +35,7 @@ except ImportError: import eventlet from eventlet import event -from oslo.config import cfg +from oslo_config import cfg from barbican.openstack.common import eventlet_backdoor from barbican.openstack.common._i18n import _LE, _LI, _LW diff --git a/barbican/openstack/common/sslutils.py b/barbican/openstack/common/sslutils.py index 1d03532b3..346cd9878 100644 --- a/barbican/openstack/common/sslutils.py +++ b/barbican/openstack/common/sslutils.py @@ -17,7 +17,7 @@ import os import ssl -from oslo.config import cfg +from oslo_config import cfg from barbican.openstack.common.gettextutils import _ # noqa diff --git a/barbican/plugin/snakeoil_ca.py b/barbican/plugin/snakeoil_ca.py index ebb0d587c..9054f3ba6 100644 --- a/barbican/plugin/snakeoil_ca.py +++ b/barbican/plugin/snakeoil_ca.py @@ -17,7 +17,7 @@ import os import uuid from OpenSSL import crypto -from oslo.config import cfg +from oslo_config import cfg from barbican.common import utils from barbican.openstack.common import gettextutils as u diff --git a/barbican/queue/keystone_listener.py b/barbican/queue/keystone_listener.py index 731d47456..95366f8d1 100644 --- a/barbican/queue/keystone_listener.py +++ b/barbican/queue/keystone_listener.py @@ -16,7 +16,7 @@ """ Server-side (i.e. worker side) Keystone notification related classes and logic. """ -from oslo import messaging +import oslo_messaging from barbican.common import utils from barbican.openstack.common import service @@ -57,14 +57,16 @@ class NotificationTask(object): as acknowledgment. Messaging server considers message is acknowledged when either return - value is `messaging.NotificationResult.HANDLED` or None. + value is `oslo_messaging.NotificationResult.HANDLED` or None. In case of successful processing of notification, the returned value is - `messaging.NotificationResult.HANDLED` + `oslo_messaging.NotificationResult.HANDLED` + + In case of notification processing error, the value returned + is oslo_messaging.NotificationResult.REQUEUE when transport + supports this feature otherwise + `oslo_messaging.NotificationResult.HANDLED` is returned. - In case of notification processing error, the value returned is - messaging.NotificationResult.REQUEUE when transport supports this - feature otherwise `messaging.NotificationResult.HANDLED` is returned. """ LOG.debug("Input keystone event publisher_id = %s", publisher_id) @@ -85,7 +87,7 @@ class NotificationTask(object): task.process(project_id=project_id, resource_type=resource_type, operation_type=operation_type) - return messaging.NotificationResult.HANDLED + return oslo_messaging.NotificationResult.HANDLED except Exception: # No need to log message here as task process method has # already logged it @@ -94,9 +96,9 @@ class NotificationTask(object): # for any exception otherwise tasks will be re-queued # repeatedly. Revisit as part of the retry task work later. if self.conf.keystone_notifications.allow_requeue: - return messaging.NotificationResult.REQUEUE + return oslo_messaging.NotificationResult.REQUEUE else: - return messaging.NotificationResult.HANDLED + return oslo_messaging.NotificationResult.HANDLED return None # in case event is not project delete def _parse_event_type(self, event_type): diff --git a/barbican/tests/plugin/test_snakeoil_ca.py b/barbican/tests/plugin/test_snakeoil_ca.py index fc042273e..68a4be1fa 100644 --- a/barbican/tests/plugin/test_snakeoil_ca.py +++ b/barbican/tests/plugin/test_snakeoil_ca.py @@ -19,7 +19,7 @@ from Crypto.Util import asn1 import fixtures import mock from OpenSSL import crypto -from oslo.config import fixture as oslo_fixture +from oslo_config import fixture as oslo_fixture import barbican.plugin.interface.certificate_manager as cm from barbican.plugin import snakeoil_ca diff --git a/barbican/tests/queue/test_keystone_listener.py b/barbican/tests/queue/test_keystone_listener.py index 0143bbc9e..3460caf50 100644 --- a/barbican/tests/queue/test_keystone_listener.py +++ b/barbican/tests/queue/test_keystone_listener.py @@ -15,8 +15,8 @@ import uuid import mock -from oslo import messaging from oslo_config import cfg +import oslo_messaging import six from barbican.openstack.common import service @@ -109,7 +109,7 @@ class WhenUsingNotificationTask(UtilMixin, utils.BaseTestCase): mock_process.assert_called_once_with(project_id=project_id, operation_type='deleted', resource_type='project') - self.assertEqual(messaging.NotificationResult.HANDLED, result) + self.assertEqual(oslo_messaging.NotificationResult.HANDLED, result) @mock.patch.object(consumer.KeystoneEventConsumer, 'process', return_value=None) @@ -124,7 +124,7 @@ class WhenUsingNotificationTask(UtilMixin, utils.BaseTestCase): mock_process.assert_called_once_with(project_id=project_id, operation_type='deleted', resource_type='project') - self.assertEqual(messaging.NotificationResult.HANDLED, result) + self.assertEqual(oslo_messaging.NotificationResult.HANDLED, result) @mock.patch.object(consumer.KeystoneEventConsumer, 'process', return_value=None) @@ -139,7 +139,7 @@ class WhenUsingNotificationTask(UtilMixin, utils.BaseTestCase): mock_process.assert_called_once_with(project_id=project_id, operation_type='deleted', resource_type='project') - self.assertEqual(messaging.NotificationResult.HANDLED, result) + self.assertEqual(oslo_messaging.NotificationResult.HANDLED, result) @mock.patch.object(consumer.KeystoneEventConsumer, 'process', return_value=None) @@ -240,7 +240,7 @@ class WhenUsingNotificationTask(UtilMixin, utils.BaseTestCase): self.assertTrue(mock_process.called, 'Should call event consumer for' ' project delete event') - self.assertEqual(messaging.NotificationResult.HANDLED, result) + self.assertEqual(oslo_messaging.NotificationResult.HANDLED, result) @mock.patch.object(consumer.KeystoneEventConsumer, 'process') def test_event_notification_with_processing_error_requeue_enabled( @@ -257,7 +257,7 @@ class WhenUsingNotificationTask(UtilMixin, utils.BaseTestCase): self.assertTrue(mock_process.called, 'Should call event consumer for' ' project delete event') - self.assertEqual(messaging.NotificationResult.REQUEUE, result) + self.assertEqual(oslo_messaging.NotificationResult.REQUEUE, result) class WhenUsingMessageServer(UtilMixin, utils.BaseTestCase):