Merge "Expect paste.deploy and gnocchi/panko options"
This commit is contained in:
commit
55b6142791
|
@ -49,17 +49,18 @@ def _conf_values_type_convert(group_name, all_options, conf):
|
||||||
for k, v in conf.items():
|
for k, v in conf.items():
|
||||||
dest = k
|
dest = k
|
||||||
try:
|
try:
|
||||||
if v is not None:
|
# 'here' and '__file__' come from paste.deploy
|
||||||
|
# 'configkey' is added by panko and gnocchi
|
||||||
|
if v is not None and k not in ['here', '__file__', 'configkey']:
|
||||||
type_, dest = opt_types[k]
|
type_, dest = opt_types[k]
|
||||||
v = type_(v)
|
v = type_(v)
|
||||||
except KeyError: # nosec
|
except KeyError: # nosec
|
||||||
# This option is not known to auth_token. v is not converted.
|
|
||||||
_LOG.warning(
|
_LOG.warning(
|
||||||
'The option "%s" in conf is not known to auth_token', k)
|
'The option "%s" is not known to keystonemiddleware', k)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
raise exceptions.ConfigurationError(
|
raise exceptions.ConfigurationError(
|
||||||
_('Unable to convert the value of %(key)s option into correct '
|
_('Unable to convert the value of option "%(key)s" into '
|
||||||
'type: %(ex)s') % {'key': k, 'ex': e})
|
'correct type: %(ex)s') % {'key': k, 'ex': e})
|
||||||
opts[dest] = v
|
opts[dest] = v
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
|
|
|
@ -514,7 +514,7 @@ class GeneralAuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
|
||||||
conf = {
|
conf = {
|
||||||
'wrong_key': '123'
|
'wrong_key': '123'
|
||||||
}
|
}
|
||||||
log = 'The option "wrong_key" in conf is not known to auth_token'
|
log = 'The option "wrong_key" is not known to keystonemiddleware'
|
||||||
auth_token.AuthProtocol(self.fake_app, conf)
|
auth_token.AuthProtocol(self.fake_app, conf)
|
||||||
self.assertThat(self.logger.output, matchers.Contains(log))
|
self.assertThat(self.logger.output, matchers.Contains(log))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue