Merge "Fix default value of RPC dispatcher access_policy"

This commit is contained in:
Jenkins 2017-09-26 14:19:54 +00:00 committed by Gerrit Code Review
commit a9d10d33cd
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.