use get_rpc_transport to obtain an RPC transport instance
Change-Id: I4aaef5eb52500f597fa8270c71dd4816167e69cb
This commit is contained in:
parent
e6dc1f0819
commit
c023d63562
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()),
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue