Fix oslo.messaging deprecation of get_transport

Oslo.messaging has deprecated get_transport and splits it into
get_notification_transport and get_rpc_transport.  This patch set updates the
code and addresses a zuul check/gate error [1].

[1] http://logs.openstack.org/55/467155/2/check/gate-keystonemiddleware-python27-ubuntu-xenial/3b6d9ef/console.html#_2017-05-24_23_49_58_453129

Change-Id: I263bd1076b47749bd14393855803419d0be9d758
This commit is contained in:
Tin Lam 2017-05-24 22:09:51 -05:00
parent e1cd9a47e1
commit 0f4d4f8010
2 changed files with 4 additions and 3 deletions

View File

@ -42,8 +42,9 @@ class _MessagingNotifier(object):
def create_notifier(conf, log):
if oslo_messaging:
transport = oslo_messaging.get_transport(conf.oslo_conf_obj,
url=conf.get('transport_url'))
transport = oslo_messaging.get_notification_transport(
conf.oslo_conf_obj,
url=conf.get('transport_url'))
notifier = oslo_messaging.Notifier(
transport,

View File

@ -69,7 +69,7 @@ class AuditNotifierConfigTest(base.BaseAuditMiddlewareTest):
app.get('/foo/bar', extra_environ=self.get_environ_header())
self.assertTrue(driver.called)
@mock.patch('oslo_messaging.get_transport')
@mock.patch('oslo_messaging.get_notification_transport')
def test_conf_middleware_messaging_and_transport_set(self, m):
transport_url = 'rabbit://me:passwd@host:5672/virtual_host'
self.cfg.config(driver='messaging',