From 1e6560ac69efb278c291817dbd76bc2c5919d2d6 Mon Sep 17 00:00:00 2001 From: john-griffith Date: Wed, 26 Mar 2014 16:47:21 -0600 Subject: [PATCH] Update config generator from OSLO Cinders sample config is out of date with recent updates needed for keystone, however we had an old version of the oslo generator so there was no way to pick these changes up locally by running the generate tool. This pulls the latest generator.py from oslo, and we run the update script to get us back in sync. Current head of oslo: commit 2eab986ef3c43f8d1e25065e3cbc1307860c25c7 Merge: 2b08343 0dbcae1 Author: Jenkins Date: Wed Mar 26 14:47:07 2014 +0000 Merge "Adds test condition in test_periodic" Change-Id: Id43becfaa39d04153167e592a1233a5aef6016c9 --- cinder/openstack/common/config/generator.py | 7 +++++- etc/cinder/cinder.conf.sample | 28 ++++++++++----------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/cinder/openstack/common/config/generator.py b/cinder/openstack/common/config/generator.py index ae112d875..4da102da3 100644 --- a/cinder/openstack/common/config/generator.py +++ b/cinder/openstack/common/config/generator.py @@ -64,6 +64,10 @@ BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), WORDWRAP_WIDTH = 60 +def raise_extension_exception(extmanager, ep, err): + raise + + def generate(argv): parser = argparse.ArgumentParser( description='generate sample configuration file', @@ -107,6 +111,7 @@ def generate(argv): 'oslo.config.opts', names=list(set(parsed_args.libraries)), invoke_on_load=False, + on_load_failure_callback=raise_extension_exception ) for ext in loader: for group, opts in ext.plugin(): @@ -229,7 +234,7 @@ def _sanitize_default(name, value): return value.replace(BASEDIR, '') elif value == _get_my_ip(): return '10.0.0.1' - elif value == socket.gethostname() and 'host' in name: + elif value in (socket.gethostname(), socket.getfqdn()) and 'host' in name: return 'cinder' elif value.strip() != value: return '"%s"' % value diff --git a/etc/cinder/cinder.conf.sample b/etc/cinder/cinder.conf.sample index c57e82445..b0b6b6e44 100644 --- a/etc/cinder/cinder.conf.sample +++ b/etc/cinder/cinder.conf.sample @@ -2031,12 +2031,6 @@ # with Identity API Server. (integer value) #http_request_max_retries=3 -# Allows to pass in the name of a fake http_handler callback -# function used instead of httplib.HTTPConnection or -# httplib.HTTPSConnection. Useful for unit testing where -# network is not available. (string value) -#http_handler= - # Single shared secret with the Keystone configuration used # for bootstrapping a Keystone installation, or otherwise # bypassing the normal authentication process. (string value) @@ -2074,20 +2068,24 @@ # value) #signing_dir= -# If defined, the memcache server(s) to use for caching (list -# value) +# Optionally specify a list of memcached server(s) to use for +# caching. If left undefined, tokens will instead be cached +# in-process. (list value) # Deprecated group/name - [DEFAULT]/memcache_servers #memcached_servers= -# In order to prevent excessive requests and validations, the -# middleware uses an in-memory cache for the tokens the -# Keystone API returns. This is only valid if memcache_servers -# is defined. Set to -1 to disable caching completely. -# (integer value) +# In order to prevent excessive effort spent validating +# tokens, the middleware caches previously-seen tokens for a +# configurable duration (in seconds). Set to -1 to disable +# caching completely. (integer value) #token_cache_time=300 -# Value only used for unit testing (integer value) -#revocation_cache_time=1 +# Determines the frequency at which the list of revoked tokens +# is retrieved from the Identity service (in seconds). A high +# number of revocation events combined with a low cache +# duration may significantly reduce performance. (integer +# value) +#revocation_cache_time=300 # (optional) if defined, indicate whether token data should be # authenticated or authenticated and encrypted. Acceptable -- 2.45.2