summaryrefslogtreecommitdiffstats
path: root/keystone/config.py
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2013-03-12 22:44:48 -0400
committerDan Prince <dprince@redhat.com>2013-03-14 14:26:54 -0400
commitc92b276f81d32eef2c23497058002f168e358ec7 (patch)
tree7e80452a2dd3de9416d6ce7bf225f2d272437ca0 /keystone/config.py
parentd51f81ba385685c8913a3c74ea3b7b7f1b150814 (diff)
downloadkeystone-c92b276f81d32eef2c23497058002f168e358ec7.tar.gz
keystone-c92b276f81d32eef2c23497058002f168e358ec7.tar.xz
keystone-c92b276f81d32eef2c23497058002f168e358ec7.zip
Remove duplicate password/token opts.
Consolidate the 'auth' method option registration in config.py. This makes it so we don't have to catch Exceptions when the default 'auth' options are registered twice and avoids some log WARNING messages as well. Fixes LP Bug #1154406. Change-Id: I301328ec3ec4823dd7fbec1e639e2841516352e5
Diffstat (limited to 'keystone/config.py')
-rw-r--r--keystone/config.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/keystone/config.py b/keystone/config.py
index 10d468ca..8f4ac16a 100644
--- a/keystone/config.py
+++ b/keystone/config.py
@@ -26,6 +26,7 @@ gettext.install('keystone', unicode=1)
_DEFAULT_LOG_FORMAT = "%(asctime)s %(levelname)8s [%(name)s] %(message)s"
_DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
+_DEFAULT_AUTH_METHODS = ['password', 'token']
common_cli_opts = [
cfg.BoolOpt('debug',
@@ -322,8 +323,13 @@ register_str('password', group='pam', default=None)
# default authentication methods
register_list('methods', group='auth',
- default=['password', 'token'])
+ default=_DEFAULT_AUTH_METHODS)
register_str('password', group='auth',
default='keystone.auth.methods.token.Token')
register_str('token', group='auth',
default='keystone.auth.methods.password.Password')
+
+# register any non-default auth methods here (used by extensions, etc)
+for method_name in CONF.auth.methods:
+ if method_name not in _DEFAULT_AUTH_METHODS:
+ config.register_str(method_name, group='auth')