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