From fa05a50249e7b08f4a9ebc751e388560abb9fffa Mon Sep 17 00:00:00 2001 From: shubhendu Date: Wed, 26 Apr 2017 10:54:04 +0530 Subject: [PATCH] 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 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: Iacb22af0836ead11043f6852fa17c6e024311a3c --- manila/rpc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manila/rpc.py b/manila/rpc.py index 5fb500a785..9fca818ce2 100644 --- a/manila/rpc.py +++ b/manila/rpc.py @@ -27,6 +27,7 @@ __all__ = [ from oslo_config import cfg import oslo_messaging as messaging +from oslo_messaging.rpc import dispatcher from oslo_serialization import jsonutils import manila.context @@ -123,12 +124,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) def get_notifier(service=None, host=None, publisher_id=None):