From 631b886cf10041b22cc201bd0fa6a1ba720dbadd Mon Sep 17 00:00:00 2001 From: Amrith Kumar Date: Tue, 6 Dec 2016 12:59:05 -0500 Subject: [PATCH] handle impending oslo.messaging deprecation When running trove, I see this deprecation message. /usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py:200: 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.access_policy) For now, I'm setting this to LegacyRPCAccessPolicy, will be making other changes in this area before long and will make our own access policy anyway. Change-Id: Ib0dc68620bbd6105349c10976695c502f6d76c13 Depends-On: Id5be526a0418db5d00cbf5cbceb4993274989e72 --- trove/rpc.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/trove/rpc.py b/trove/rpc.py index dff472ee4b..50748aea08 100644 --- a/trove/rpc.py +++ b/trove/rpc.py @@ -31,6 +31,7 @@ __all__ = [ from oslo_config import cfg import oslo_messaging as messaging +from oslo_messaging.rpc import dispatcher import trove.common.exception from trove.common.rpc import secure_serializer as ssz @@ -118,11 +119,13 @@ def get_server(target, endpoints, key, serializer=None, serializer = secure_serializer( sz.TroveRequestContextSerializer(serializer), key) - return messaging.get_rpc_server(TRANSPORT, - target, - endpoints, - executor=executor, - serializer=serializer) + return messaging.get_rpc_server( + TRANSPORT, + target, + endpoints, + executor=executor, + serializer=serializer, + access_policy=dispatcher.LegacyRPCAccessPolicy) def get_notifier(service=None, host=None, publisher_id=None):