Merge "Port to oslo.messaging"
This commit is contained in:
13
nova/test.py
13
nova/test.py
@@ -35,6 +35,7 @@ import uuid
|
||||
|
||||
import fixtures
|
||||
from oslo.config import cfg
|
||||
from oslo.messaging import conffixture as messaging_conffixture
|
||||
import testtools
|
||||
|
||||
from nova import context
|
||||
@@ -47,6 +48,7 @@ from nova.openstack.common.fixture import moxstubout
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import timeutils
|
||||
from nova import paths
|
||||
from nova import rpc
|
||||
from nova import service
|
||||
from nova.tests import conf_fixture
|
||||
from nova.tests import policy_fixture
|
||||
@@ -232,10 +234,21 @@ class TestCase(testtools.TestCase):
|
||||
stderr = self.useFixture(fixtures.StringStream('stderr')).stream
|
||||
self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
|
||||
|
||||
rpc.add_extra_exmods('nova.test')
|
||||
self.addCleanup(rpc.clear_extra_exmods)
|
||||
self.addCleanup(rpc.cleanup)
|
||||
|
||||
fs = '%(levelname)s [%(name)s] %(message)s'
|
||||
self.log_fixture = self.useFixture(fixtures.FakeLogger(format=fs))
|
||||
self.useFixture(conf_fixture.ConfFixture(CONF))
|
||||
|
||||
self.messaging_conf = messaging_conffixture.ConfFixture(CONF)
|
||||
self.messaging_conf.transport_driver = 'fake'
|
||||
self.messaging_conf.response_timeout = 15
|
||||
self.useFixture(self.messaging_conf)
|
||||
|
||||
rpc.init(CONF)
|
||||
|
||||
if self.USES_DB:
|
||||
global _DB_CACHE
|
||||
if not _DB_CACHE:
|
||||
|
@@ -39,6 +39,7 @@ from xml.sax import saxutils
|
||||
import eventlet
|
||||
import netaddr
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
import six
|
||||
|
||||
from nova import exception
|
||||
@@ -49,7 +50,6 @@ from nova.openstack.common import importutils
|
||||
from nova.openstack.common import lockutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import processutils
|
||||
from nova.openstack.common.rpc import common as rpc_common
|
||||
from nova.openstack.common import timeutils
|
||||
|
||||
notify_decorator = 'nova.notifications.notify_decorator'
|
||||
@@ -929,8 +929,8 @@ class ExceptionHelper(object):
|
||||
def wrapper(*args, **kwargs):
|
||||
try:
|
||||
return func(*args, **kwargs)
|
||||
except rpc_common.ClientException as e:
|
||||
raise (e._exc_info[1], None, e._exc_info[2])
|
||||
except messaging.ExpectedException as e:
|
||||
raise (e.exc_info[1], None, e.exc_info[2])
|
||||
return wrapper
|
||||
|
||||
|
||||
|
@@ -32,3 +32,4 @@ wsgiref>=0.1.2
|
||||
oslo.config>=1.2.0
|
||||
oslo.rootwrap
|
||||
pycadf>=0.1.9
|
||||
oslo.messaging>=1.3.0a4
|
||||
|
@@ -128,6 +128,14 @@ nova.api.v3.extensions.server.rebuild =
|
||||
nova.api.v3.extensions.server.update =
|
||||
access_ips = nova.api.openstack.compute.plugins.v3.access_ips:AccessIPs
|
||||
|
||||
# These are for backwards compat with Havana notification_driver configuration values
|
||||
oslo.messaging.notify.drivers =
|
||||
nova.openstack.common.notififier.log_notifier = oslo.messaging.notify._impl_log:LogDriver
|
||||
nova.openstack.common.notififier.no_op_notifier = oslo.messaging.notify._impl_noop:NoOpDriver
|
||||
nova.openstack.common.notififier.rpc_notifier2 = oslo.messaging.notify._impl_messaging:MessagingV2Driver
|
||||
nova.openstack.common.notififier.rpc_notifier = oslo.messaging.notify._impl_messaging:MessagingDriver
|
||||
nova.openstack.common.notififier.test_notifier = oslo.messaging.notify._impl_test:TestDriver
|
||||
|
||||
[build_sphinx]
|
||||
all_files = 1
|
||||
build-dir = doc/build
|
||||
|
Reference in New Issue
Block a user