Merge "Set access_policy for messaging's dispatcher"
This commit is contained in:
commit
9e0e188119
@ -25,6 +25,7 @@ __all__ = [
|
||||
]
|
||||
|
||||
import oslo_messaging as messaging
|
||||
from oslo_messaging.rpc import dispatcher
|
||||
|
||||
import masakari.context
|
||||
import masakari.exception
|
||||
@ -104,12 +105,14 @@ def get_client(target, version_cap=None, serializer=None):
|
||||
|
||||
def get_server(target, endpoints, serializer=None):
|
||||
assert TRANSPORT is not None
|
||||
access_policy = dispatcher.DefaultRPCAccessPolicy
|
||||
serializer = RequestContextSerializer(serializer)
|
||||
return messaging.get_rpc_server(TRANSPORT,
|
||||
target,
|
||||
endpoints,
|
||||
executor='eventlet',
|
||||
serializer=serializer)
|
||||
serializer=serializer,
|
||||
access_policy=access_policy)
|
||||
|
||||
|
||||
class RPCAPI(object):
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
import mock
|
||||
import oslo_messaging as messaging
|
||||
from oslo_messaging.rpc import dispatcher
|
||||
|
||||
from masakari import context
|
||||
from masakari import rpc
|
||||
@ -106,12 +107,14 @@ class RPCAPITestCase(test.TestCase):
|
||||
ends = mock.Mock()
|
||||
mock_ser.return_value = ser
|
||||
mock_get.return_value = 'server'
|
||||
access_policy = dispatcher.DefaultRPCAccessPolicy
|
||||
|
||||
server = rpc.get_server(tgt, ends, serializer='foo')
|
||||
|
||||
mock_ser.assert_called_once_with('foo')
|
||||
mock_get.assert_called_once_with(rpc.TRANSPORT, tgt, ends,
|
||||
executor='eventlet', serializer=ser)
|
||||
executor='eventlet', serializer=ser,
|
||||
access_policy=access_policy)
|
||||
self.assertEqual('server', server)
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@ keystonemiddleware!=4.5.0,>=4.2.0 # Apache-2.0
|
||||
microversion-parse>=0.1.2 # Apache-2.0
|
||||
oslo.config>=3.10.0 # Apache-2.0
|
||||
oslo.db>=4.1.0 # Apache-2.0
|
||||
oslo.messaging>=5.2.0 # Apache-2.0
|
||||
oslo.messaging>=5.11.0 # Apache-2.0
|
||||
oslo.i18n>=2.1.0 # Apache-2.0
|
||||
oslo.log>=1.14.0 # Apache-2.0
|
||||
oslo.middleware>=3.0.0 # Apache-2.0
|
||||
|
Loading…
Reference in New Issue
Block a user