Fix default value of RPC dispatcher access_policy

Change-Id: I4d30ff269b2e34f4409e8d1ce822eb93918cf5a2
Closes-Bug: #1712393
This commit is contained in:
zhangxuanyuan 2017-09-04 14:25:32 +08:00 committed by Rajath Agasthya
parent c2338ee325
commit 3a9c01ffe9
4 changed files with 7 additions and 16 deletions

View File

@ -170,9 +170,7 @@ class RPCDispatcher(dispatcher.DispatcherBase):
raise TypeError('access_policy must be a subclass of '
'RPCAccessPolicyBase')
else:
# TODO(pvinci): Change to DefaultRPCAccessPolicy when setting to
# DefaultRCPAccessPolicy no longer breaks in tempest tests.
self.access_policy = LegacyRPCAccessPolicy()
self.access_policy = DefaultRPCAccessPolicy()
@staticmethod
def _is_namespace(target, namespace):

View File

@ -130,8 +130,6 @@ __all__ = [
import logging
import sys
from debtcollector.updating import updated_kwarg_default_value
from oslo_messaging._i18n import _LE
from oslo_messaging.rpc import dispatcher as rpc_dispatcher
from oslo_messaging import server as msg_server
@ -187,15 +185,6 @@ class RPCServer(msg_server.MessageHandlingServer):
del failure
@updated_kwarg_default_value('access_policy', None,
rpc_dispatcher.DefaultRPCAccessPolicy,
message='access_policy defaults to '
'LegacyRPCAccessPolicy which '
'exposes private methods. Explicitly '
'set access_policy to '
'DefaultRPCAccessPolicy or '
'ExplicitRPCAccessPolicy.',
version='?')
def get_rpc_server(transport, target, endpoints,
executor='blocking', serializer=None, access_policy=None):
"""Construct an RPC server.
@ -212,7 +201,7 @@ def get_rpc_server(transport, target, endpoints,
:param serializer: an optional entity serializer
:type serializer: Serializer
:param access_policy: an optional access policy.
Defaults to LegacyRPCAccessPolicy
Defaults to DefaultRPCAccessPolicy
:type access_policy: RPCAccessPolicyBase
"""
dispatcher = rpc_dispatcher.RPCDispatcher(endpoints, serializer,

View File

@ -158,7 +158,6 @@ class TestRPCServer(test_utils.BaseTestCase, ServerSetupMixin):
oslo_messaging.get_rpc_server(transport, target,
endpoints, serializer=serializer)
self.assertEqual([
mock.call(mock.ANY, category=FutureWarning, stacklevel=3),
mock.call("blocking executor is deprecated. Executor default will "
"be removed. Use explicitly threading or eventlet "
"instead in version 'pike' and will be removed in "

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Change the default value of RPC dispatcher access_policy
to DefaultRPCAccessPolicy.