use get_rpc_transport to obtain an RPC transport instance

Change-Id: I4aaef5eb52500f597fa8270c71dd4816167e69cb
This commit is contained in:
zhurong 2019-01-08 16:33:46 +08:00
parent e6dc1f0819
commit c023d63562
4 changed files with 6 additions and 7 deletions

View File

@ -64,7 +64,7 @@ class EngineService(service.Service):
SchemaEndpoint()
]
transport = messaging.get_notification_transport(CONF)
transport = messaging.get_rpc_transport(CONF)
s_target = target.Target('murano', 'tasks', server=str(uuid.uuid4()))
access_policy = dispatcher.DefaultRPCAccessPolicy
self.server = messaging.get_rpc_server(

View File

@ -57,7 +57,7 @@ class EngineClient(object):
def api():
global TRANSPORT
if TRANSPORT is None:
TRANSPORT = messaging.get_notification_transport(CONF)
TRANSPORT = messaging.get_rpc_transport(CONF)
return ApiClient(TRANSPORT)
@ -65,6 +65,6 @@ def api():
def engine():
global TRANSPORT
if TRANSPORT is None:
TRANSPORT = messaging.get_notification_transport(CONF)
TRANSPORT = messaging.get_rpc_transport(CONF)
return EngineClient(TRANSPORT)

View File

@ -76,8 +76,7 @@ class Notification(object):
return
if Notification.transport is None:
Notification.transport = messaging.get_notification_transport(
CONF)
Notification.transport = messaging.get_notification_transport(CONF)
self._notifier = messaging.Notifier(
Notification.transport,
publisher_id=('murano.%s' % socket.gethostname()),

View File

@ -39,7 +39,7 @@ class TestEngineService(base.MuranoTestCase):
def test_start_stop_reset(self, mock_messaging, mock_start,
mock_stop, mock_reset):
self.engine.start()
self.assertTrue(mock_messaging.get_notification_transport.called)
self.assertTrue(mock_messaging.get_rpc_transport.called)
self.assertTrue(mock_messaging.get_rpc_server.called)
self.assertTrue(mock_start.called)
self.engine.stop()
@ -52,7 +52,7 @@ class TestEngineService(base.MuranoTestCase):
@mock.patch('murano.common.engine.messaging')
def test_stop_graceful(self, mock_messaging, mock_start, mock_stop):
self.engine.start()
self.assertTrue(mock_messaging.get_notification_transport.called)
self.assertTrue(mock_messaging.get_rpc_transport.called)
self.assertTrue(mock_messaging.get_rpc_server.called)
self.assertTrue(mock_start.called)
self.engine.stop(graceful=True)