
The first attempt at getting all the tests to work missed out the config_overrides in the base test class and the 'role' and 'assignment' groups. Also, sha1_mangle_key was added to encode the key before calling dogpile's sha1_mangle_key to support all the python34 tests. Removed the skipIf's added for py34 as the tests are now working. Also removed the testtools from requirements as we don't need it anymore. Change-Id: I0e09429e6739dc946f6e15398ccb264b4d62bb42
155 lines
7.4 KiB
Python
155 lines
7.4 KiB
Python
# Copyright 2012 OpenStack Foundation
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from oslo_config import cfg
|
|
|
|
|
|
FILE_OPTIONS = {
|
|
'cache': [
|
|
cfg.StrOpt('config_prefix', default='cache.keystone',
|
|
help='Prefix for building the configuration dictionary '
|
|
'for the cache region. This should not need to be '
|
|
'changed unless there is another dogpile.cache '
|
|
'region with the same configuration name.'),
|
|
cfg.IntOpt('expiration_time', default=600,
|
|
help='Default TTL, in seconds, for any cached item in '
|
|
'the dogpile.cache region. This applies to any '
|
|
'cached method that doesn\'t have an explicit '
|
|
'cache expiration time defined for it.'),
|
|
# NOTE(morganfainberg): the dogpile.cache.memory acceptable in devstack
|
|
# and other such single-process/thread deployments. Running
|
|
# dogpile.cache.memory in any other configuration has the same pitfalls
|
|
# as the KVS token backend. It is recommended that either Redis or
|
|
# Memcached are used as the dogpile backend for real workloads. To
|
|
# prevent issues with the memory cache ending up in "production"
|
|
# unintentionally, we register a no-op as the keystone default caching
|
|
# backend.
|
|
cfg.StrOpt('backend', default='oslo_cache.noop',
|
|
help='Dogpile.cache backend module. It is recommended '
|
|
'that Memcache with pooling '
|
|
'(keystone.cache.memcache_pool) or Redis '
|
|
'(dogpile.cache.redis) be used in production '
|
|
'deployments. Small workloads (single process) '
|
|
'like devstack can use the dogpile.cache.memory '
|
|
'backend.'),
|
|
cfg.MultiStrOpt('backend_argument', default=[], secret=True,
|
|
help='Arguments supplied to the backend module. '
|
|
'Specify this option once per argument to be '
|
|
'passed to the dogpile.cache backend. Example '
|
|
'format: "<argname>:<value>".'),
|
|
cfg.ListOpt('proxies', default=[],
|
|
help='Proxy classes to import that will affect the way '
|
|
'the dogpile.cache backend functions. See the '
|
|
'dogpile.cache documentation on '
|
|
'changing-backend-behavior.'),
|
|
cfg.BoolOpt('enabled', default=False,
|
|
help='Global toggle for all caching using the '
|
|
'should_cache_fn mechanism.'),
|
|
cfg.BoolOpt('debug_cache_backend', default=False,
|
|
help='Extra debugging from the cache backend (cache '
|
|
'keys, get/set/delete/etc calls). This is only '
|
|
'really useful if you need to see the specific '
|
|
'cache-backend get/set/delete calls with the '
|
|
'keys/values. Typically this should be left set '
|
|
'to false.'),
|
|
cfg.ListOpt('memcache_servers', default=['localhost:11211'],
|
|
help='Memcache servers in the format of "host:port".'
|
|
' (dogpile.cache.memcache and keystone.cache.memcache_pool'
|
|
' backends only).'),
|
|
cfg.IntOpt('memcache_dead_retry',
|
|
default=5 * 60,
|
|
help='Number of seconds memcached server is considered dead'
|
|
' before it is tried again. (dogpile.cache.memcache and'
|
|
' keystone.cache.memcache_pool backends only).'),
|
|
cfg.IntOpt('memcache_socket_timeout',
|
|
default=3,
|
|
help='Timeout in seconds for every call to a server.'
|
|
' (dogpile.cache.memcache and keystone.cache.memcache_pool'
|
|
' backends only).'),
|
|
cfg.IntOpt('memcache_pool_maxsize',
|
|
default=10,
|
|
help='Max total number of open connections to every'
|
|
' memcached server. (keystone.cache.memcache_pool backend'
|
|
' only).'),
|
|
cfg.IntOpt('memcache_pool_unused_timeout',
|
|
default=60,
|
|
help='Number of seconds a connection to memcached is held'
|
|
' unused in the pool before it is closed.'
|
|
' (keystone.cache.memcache_pool backend only).'),
|
|
cfg.IntOpt('memcache_pool_connection_get_timeout',
|
|
default=10,
|
|
help='Number of seconds that an operation will wait to get '
|
|
'a memcache client connection.'),
|
|
],
|
|
'role': [
|
|
# The role driver has no default for backward compatibility reasons.
|
|
# If role driver is not specified, the assignment driver chooses
|
|
# the backend
|
|
cfg.StrOpt('driver',
|
|
help='Role backend driver.'),
|
|
cfg.BoolOpt('caching', default=True,
|
|
help='Toggle for role caching. This has no effect '
|
|
'unless global caching is enabled.'),
|
|
cfg.IntOpt('cache_time',
|
|
help='TTL (in seconds) to cache role data. This has '
|
|
'no effect unless global caching is enabled.'),
|
|
cfg.IntOpt('list_limit',
|
|
help='Maximum number of entities that will be returned '
|
|
'in a role collection.'),
|
|
],
|
|
'assignment': [
|
|
# assignment has no default for backward compatibility reasons.
|
|
# If assignment driver is not specified, the identity driver chooses
|
|
# the backend
|
|
cfg.StrOpt('driver',
|
|
help='Assignment backend driver.'),
|
|
],
|
|
}
|
|
|
|
|
|
CONF = cfg.CONF
|
|
|
|
|
|
def configure(conf=None):
|
|
if conf is None:
|
|
conf = CONF
|
|
|
|
for section in FILE_OPTIONS:
|
|
for option in FILE_OPTIONS[section]:
|
|
conf.register_opt(option, group=section)
|
|
|
|
|
|
def list_opts():
|
|
"""Return a list of oslo_config options available in Keystone.
|
|
|
|
The returned list includes all oslo_config options which are registered as
|
|
the "FILE_OPTIONS" in keystone.common.config. This list will not include
|
|
the options from the oslo-incubator library or any options registered
|
|
dynamically at run time.
|
|
|
|
Each object in the list is a two element tuple. The first element of
|
|
each tuple is the name of the group under which the list of options in the
|
|
second element will be registered. A group name of None corresponds to the
|
|
[DEFAULT] group in config files.
|
|
|
|
This function is also discoverable via the 'oslo_config.opts' entry point
|
|
under the 'keystone.config.opts' namespace.
|
|
|
|
The purpose of this is to allow tools like the Oslo sample config file
|
|
generator to discover the options exposed to users by this library.
|
|
|
|
:returns: a list of (group_name, opts) tuples
|
|
"""
|
|
return list(FILE_OPTIONS.items())
|