From c2fdd3b3bfbc089df14c9b1457282e0c7cb74475 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Thu, 26 Jan 2017 20:09:12 -0500 Subject: [PATCH] add additional deprecation warnings for KVS options We had a single deprecation warning for KVS functionality being removed in Pike, located at keystone/common/kvs/core.py [1] This change adds deprecation warnings to the various config options and backends that used core.py. [1] https://github.com/openstack/keystone/blob/master/keystone/common/kvs/core.py#L98-L101 Related-Bug: 1077282 bp deprecated-as-of-ocata Change-Id: Ia63f0ac8543cf1e938baa712e21f08f582dc26ed --- keystone/common/kvs/backends/inmemdb.py | 5 +++++ keystone/common/kvs/backends/memcached.py | 5 +++++ keystone/conf/kvs.py | 19 +++++++++++++++++++ keystone/conf/memcache.py | 10 ++++++++++ keystone/token/persistence/backends/kvs.py | 5 +++++ ...precated-as-of-ocata-a5b2f1e3e39f818e.yaml | 10 ++++++++++ 6 files changed, 54 insertions(+) diff --git a/keystone/common/kvs/backends/inmemdb.py b/keystone/common/kvs/backends/inmemdb.py index 379b54bff7..e37bd51fbd 100644 --- a/keystone/common/kvs/backends/inmemdb.py +++ b/keystone/common/kvs/backends/inmemdb.py @@ -17,11 +17,16 @@ import copy from dogpile.cache import api +from oslo_log import versionutils NO_VALUE = api.NO_VALUE +@versionutils.deprecated( + versionutils.deprecated.OCATA, + what='keystone.common.kvs.backends.MemoryBackend', + remove_in=+1) class MemoryBackend(api.CacheBackend): """A backend that uses a plain dictionary. diff --git a/keystone/common/kvs/backends/memcached.py b/keystone/common/kvs/backends/memcached.py index 3bb07cd4a2..09dc6f739d 100644 --- a/keystone/common/kvs/backends/memcached.py +++ b/keystone/common/kvs/backends/memcached.py @@ -20,6 +20,7 @@ import time from dogpile.cache import api from dogpile.cache.backends import memcached from oslo_cache.backends import memcache_pool +from oslo_log import versionutils from six.moves import range import keystone.conf @@ -72,6 +73,10 @@ class MemcachedLock(object): client.delete(self.key) +@versionutils.deprecated( + versionutils.deprecated.OCATA, + what='keystone.common.kvs.backends.MemcachedBackend', + remove_in=+1) class MemcachedBackend(object): """Pivot point to leverage the various dogpile.cache memcached backends. diff --git a/keystone/conf/kvs.py b/keystone/conf/kvs.py index 489b6831f5..9bacdbc7c5 100644 --- a/keystone/conf/kvs.py +++ b/keystone/conf/kvs.py @@ -11,13 +11,23 @@ # under the License. from oslo_config import cfg +from oslo_log import versionutils from keystone.conf import utils +_DEPRECATE_KVS_MSG = utils.fmt(""" +This option has been deprecated in the O release and will be removed in the P +release. Use SQL backends instead. +""") + + backends = cfg.ListOpt( 'backends', default=[], + deprecated_for_removal=True, + deprecated_reason=_DEPRECATE_KVS_MSG, + deprecated_since=versionutils.deprecated.OCATA, help=utils.fmt(""" Extra `dogpile.cache` backend modules to register with the `dogpile.cache` library. It is not necessary to set this value unless you are providing a @@ -27,6 +37,9 @@ custom KVS backend beyond what `dogpile.cache` already supports. config_prefix = cfg.StrOpt( 'config_prefix', default='keystone.kvs', + deprecated_for_removal=True, + deprecated_reason=_DEPRECATE_KVS_MSG, + deprecated_since=versionutils.deprecated.OCATA, help=utils.fmt(""" Prefix for building the configuration dictionary for the KVS region. This should not need to be changed unless there is another `dogpile.cache` region @@ -36,6 +49,9 @@ with the same configuration name. enable_key_mangler = cfg.BoolOpt( 'enable_key_mangler', default=True, + deprecated_for_removal=True, + deprecated_reason=_DEPRECATE_KVS_MSG, + deprecated_since=versionutils.deprecated.OCATA, help=utils.fmt(""" Set to false to disable using a key-mangling function, which ensures fixed-length keys are used in the KVS store. This is configurable for debugging @@ -47,6 +63,9 @@ default_lock_timeout = cfg.IntOpt( 'default_lock_timeout', default=5, min=0, + deprecated_for_removal=True, + deprecated_reason=_DEPRECATE_KVS_MSG, + deprecated_since=versionutils.deprecated.OCATA, help=utils.fmt(""" Number of seconds after acquiring a distributed lock that the backend should consider the lock to be expired. This option should be tuned relative to the diff --git a/keystone/conf/memcache.py b/keystone/conf/memcache.py index 20f747389d..989c639bb1 100644 --- a/keystone/conf/memcache.py +++ b/keystone/conf/memcache.py @@ -11,13 +11,23 @@ # under the License. from oslo_config import cfg +from oslo_log import versionutils from keystone.conf import utils +_DEPRECATE_KVS_MSG = utils.fmt(""" +This option has been deprecated in the O release and will be removed in the P +release. Use oslo.cache instead. +""") + + servers = cfg.ListOpt( 'servers', default=['localhost:11211'], + deprecated_for_removal=True, + deprecated_reason=_DEPRECATE_KVS_MSG, + deprecated_since=versionutils.deprecated.OCATA, help=utils.fmt(""" Comma-separated list of memcached servers in the format of `host:port,host:port` that keystone should use for the `memcache` token diff --git a/keystone/token/persistence/backends/kvs.py b/keystone/token/persistence/backends/kvs.py index 3d2a5018e9..e749f13464 100644 --- a/keystone/token/persistence/backends/kvs.py +++ b/keystone/token/persistence/backends/kvs.py @@ -18,6 +18,7 @@ import copy import threading from oslo_log import log +from oslo_log import versionutils from oslo_utils import timeutils import six @@ -36,6 +37,10 @@ LOG = log.getLogger(__name__) STORE_CONF_LOCK = threading.Lock() +@versionutils.deprecated( + versionutils.deprecated.OCATA, + what='keystone.token.persistence.backends.kvs.Token', + remove_in=+1) class Token(token.persistence.TokenDriverBase): """KeyValueStore backend for tokens. diff --git a/releasenotes/notes/deprecated-as-of-ocata-a5b2f1e3e39f818e.yaml b/releasenotes/notes/deprecated-as-of-ocata-a5b2f1e3e39f818e.yaml index 52f7522102..761ded960d 100644 --- a/releasenotes/notes/deprecated-as-of-ocata-a5b2f1e3e39f818e.yaml +++ b/releasenotes/notes/deprecated-as-of-ocata-a5b2f1e3e39f818e.yaml @@ -7,3 +7,13 @@ deprecations: It's recommended to replace the ``endpoint_filter.sql`` catalog backend with the ``sql`` backend. The ``endpoint_filter.sql`` backend will be removed in the `Pike` release. + - > + [`blueprint deprecated-as-of-ocata `_] + Various KVS backends and config options have been deprecated and will be + removed in the `Pike` release. This includes: + + * ``keystone.common.kvs.backends.inmemdb.MemoryBackend`` + * ``keystone.common.kvs.backends.memcached.MemcachedBackend`` + * ``keystone.token.persistence.backends.kvs.Token`` + * all config options under ``[kvs]`` in `keystone.conf` + * the config option ``[memcached] servers`` in `keystone.conf`