From 3a9c01ffe9fa0095c594ed219471e9f78fa25d59 Mon Sep 17 00:00:00 2001 From: zhangxuanyuan Date: Mon, 4 Sep 2017 14:25:32 +0800 Subject: [PATCH] Fix default value of RPC dispatcher access_policy Change-Id: I4d30ff269b2e34f4409e8d1ce822eb93918cf5a2 Closes-Bug: #1712393 --- oslo_messaging/rpc/dispatcher.py | 4 +--- oslo_messaging/rpc/server.py | 13 +------------ oslo_messaging/tests/rpc/test_server.py | 1 - .../fix-access_policy-deafult-a6954a147cb002b0.yaml | 5 +++++ 4 files changed, 7 insertions(+), 16 deletions(-) create mode 100644 releasenotes/notes/fix-access_policy-deafult-a6954a147cb002b0.yaml diff --git a/oslo_messaging/rpc/dispatcher.py b/oslo_messaging/rpc/dispatcher.py index fe82f27e9..fda20fe0e 100644 --- a/oslo_messaging/rpc/dispatcher.py +++ b/oslo_messaging/rpc/dispatcher.py @@ -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): diff --git a/oslo_messaging/rpc/server.py b/oslo_messaging/rpc/server.py index b91fffecf..18d5869d3 100644 --- a/oslo_messaging/rpc/server.py +++ b/oslo_messaging/rpc/server.py @@ -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, diff --git a/oslo_messaging/tests/rpc/test_server.py b/oslo_messaging/tests/rpc/test_server.py index e720e6b5a..693e88a52 100644 --- a/oslo_messaging/tests/rpc/test_server.py +++ b/oslo_messaging/tests/rpc/test_server.py @@ -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 " diff --git a/releasenotes/notes/fix-access_policy-deafult-a6954a147cb002b0.yaml b/releasenotes/notes/fix-access_policy-deafult-a6954a147cb002b0.yaml new file mode 100644 index 000000000..7e7c8d1f7 --- /dev/null +++ b/releasenotes/notes/fix-access_policy-deafult-a6954a147cb002b0.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Change the default value of RPC dispatcher access_policy + to DefaultRPCAccessPolicy.