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
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import os
|
||||
import stat
|
||||
import tempfile
|
||||
|
||||
from oslo.utils import excutils
|
||||
from oslo_utils import excutils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user