Browse Source

use get_rpc_transport to obtain an RPC transport instance

Change-Id: I4aaef5eb52500f597fa8270c71dd4816167e69cb
zhurong 3 months ago
parent
commit
c023d63562

+ 1
- 1
murano/common/engine.py View File

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

+ 2
- 2
murano/common/rpc.py View File

@@ -57,7 +57,7 @@ class EngineClient(object):
57 57
 def api():
58 58
     global TRANSPORT
59 59
     if TRANSPORT is None:
60
-        TRANSPORT = messaging.get_notification_transport(CONF)
60
+        TRANSPORT = messaging.get_rpc_transport(CONF)
61 61
 
62 62
     return ApiClient(TRANSPORT)
63 63
 
@@ -65,6 +65,6 @@ def api():
65 65
 def engine():
66 66
     global TRANSPORT
67 67
     if TRANSPORT is None:
68
-        TRANSPORT = messaging.get_notification_transport(CONF)
68
+        TRANSPORT = messaging.get_rpc_transport(CONF)
69 69
 
70 70
     return EngineClient(TRANSPORT)

+ 1
- 2
murano/engine/system/status_reporter.py View File

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

+ 2
- 2
murano/tests/unit/common/test_engine.py View File

@@ -39,7 +39,7 @@ class TestEngineService(base.MuranoTestCase):
39 39
     def test_start_stop_reset(self, mock_messaging, mock_start,
40 40
                               mock_stop, mock_reset):
41 41
         self.engine.start()
42
-        self.assertTrue(mock_messaging.get_notification_transport.called)
42
+        self.assertTrue(mock_messaging.get_rpc_transport.called)
43 43
         self.assertTrue(mock_messaging.get_rpc_server.called)
44 44
         self.assertTrue(mock_start.called)
45 45
         self.engine.stop()
@@ -52,7 +52,7 @@ class TestEngineService(base.MuranoTestCase):
52 52
     @mock.patch('murano.common.engine.messaging')
53 53
     def test_stop_graceful(self, mock_messaging, mock_start, mock_stop):
54 54
         self.engine.start()
55
-        self.assertTrue(mock_messaging.get_notification_transport.called)
55
+        self.assertTrue(mock_messaging.get_rpc_transport.called)
56 56
         self.assertTrue(mock_messaging.get_rpc_server.called)
57 57
         self.assertTrue(mock_start.called)
58 58
         self.engine.stop(graceful=True)

Loading…
Cancel
Save