summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshubhendu <shubhendu.poothia@nectechnologies.in>2017-06-15 10:20:46 +0530
committershubhendu <shubhendu.poothia@nectechnologies.in>2017-06-15 10:23:41 +0530
commit3e1ffeeaaaeed5f076c0807f277ad2f9623be3d8 (patch)
tree251112cfdb04f6f79574c127fc94766ede3201bd
parent9abab3ac7ffa41615ea196d625e8f15d995b28c1 (diff)
Set access_policy for messaging's dispatcher
oslo.messaging allow dispatcher to restrict endpoint methods since 5.11.0 in d3a8f280ebd6fd12865fd20c4d772774e39aefa2, set with DefaultRPCAccessPolicy to fix FutureWarning like: FutureWarning: The access_policy argument is changing its default value to <class 'oslo_messaging.rpc.dispatcher.DefaultRPCAccessPolicy'> in version '?', please update the code to explicitly set None as the value: access_policy defaults to LegacyRPCAccessPolicy which exposes private methods. Explicitly set access_policy to DefaultRPCAccessPolicy or ExplicitRPCAccessPolicy. Change-Id: Ide12f0b458e60400b7ae7878841edd2e4f808bdb
Notes
Notes (review): Code-Review+2: Michal Gershenzon <michal.gershenzon@nokia.com> Code-Review+2: Renat Akhmerov <renat.akhmerov@gmail.com> Workflow+1: Renat Akhmerov <renat.akhmerov@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 15 Jun 2017 10:00:39 +0000 Reviewed-on: https://review.openstack.org/474451 Project: openstack/mistral Branch: refs/heads/master
-rw-r--r--mistral/rpc/oslo/oslo_server.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mistral/rpc/oslo/oslo_server.py b/mistral/rpc/oslo/oslo_server.py
index a0e17bc..a78f2c2 100644
--- a/mistral/rpc/oslo/oslo_server.py
+++ b/mistral/rpc/oslo/oslo_server.py
@@ -13,6 +13,7 @@
13# limitations under the License. 13# limitations under the License.
14 14
15import oslo_messaging as messaging 15import oslo_messaging as messaging
16from oslo_messaging.rpc import dispatcher
16 17
17from mistral import context as ctx 18from mistral import context as ctx
18from mistral.rpc import base as rpc 19from mistral.rpc import base as rpc
@@ -42,12 +43,14 @@ class OsloRPCServer(rpc.RPCServer):
42 43
43 # TODO(rakhmerov): rpc.get_transport() should be in oslo.messaging 44 # TODO(rakhmerov): rpc.get_transport() should be in oslo.messaging
44 # related module. 45 # related module.
46 access_policy = dispatcher.DefaultRPCAccessPolicy
45 self.oslo_server = messaging.get_rpc_server( 47 self.oslo_server = messaging.get_rpc_server(
46 rpc.get_transport(), 48 rpc.get_transport(),
47 target, 49 target,
48 self.endpoints, 50 self.endpoints,
49 executor=executor, 51 executor=executor,
50 serializer=ctx.RpcContextSerializer() 52 serializer=ctx.RpcContextSerializer(),
53 access_policy=access_policy
51 ) 54 )
52 55
53 self.oslo_server.start() 56 self.oslo_server.start()