summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-26 18:29:26 +0000
committerGerrit Code Review <review@openstack.org>2018-10-26 18:29:26 +0000
commit55b61427911a84ebac27604e0ca50ded8eae60f9 (patch)
tree76b0e554688c773ff6559543a45b53b64e59f84a
parentfc51082ef43e316bbfa65c16dd6483af1f2092e7 (diff)
parent0c0eae3b1eb537159f26c82647fb61cc3de8536a (diff)
Merge "Expect paste.deploy and gnocchi/panko options"
-rw-r--r--keystonemiddleware/_common/config.py11
-rw-r--r--keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py2
2 files changed, 7 insertions, 6 deletions
diff --git a/keystonemiddleware/_common/config.py b/keystonemiddleware/_common/config.py
index 3e38eba..de701b0 100644
--- a/keystonemiddleware/_common/config.py
+++ b/keystonemiddleware/_common/config.py
@@ -49,17 +49,18 @@ def _conf_values_type_convert(group_name, all_options, conf):
49 for k, v in conf.items(): 49 for k, v in conf.items():
50 dest = k 50 dest = k
51 try: 51 try:
52 if v is not None: 52 # 'here' and '__file__' come from paste.deploy
53 # 'configkey' is added by panko and gnocchi
54 if v is not None and k not in ['here', '__file__', 'configkey']:
53 type_, dest = opt_types[k] 55 type_, dest = opt_types[k]
54 v = type_(v) 56 v = type_(v)
55 except KeyError: # nosec 57 except KeyError: # nosec
56 # This option is not known to auth_token. v is not converted.
57 _LOG.warning( 58 _LOG.warning(
58 'The option "%s" in conf is not known to auth_token', k) 59 'The option "%s" is not known to keystonemiddleware', k)
59 except ValueError as e: 60 except ValueError as e:
60 raise exceptions.ConfigurationError( 61 raise exceptions.ConfigurationError(
61 _('Unable to convert the value of %(key)s option into correct ' 62 _('Unable to convert the value of option "%(key)s" into '
62 'type: %(ex)s') % {'key': k, 'ex': e}) 63 'correct type: %(ex)s') % {'key': k, 'ex': e})
63 opts[dest] = v 64 opts[dest] = v
64 65
65 return opts 66 return opts
diff --git a/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py b/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py
index 9051d71..43806a7 100644
--- a/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py
+++ b/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py
@@ -514,7 +514,7 @@ class GeneralAuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
514 conf = { 514 conf = {
515 'wrong_key': '123' 515 'wrong_key': '123'
516 } 516 }
517 log = 'The option "wrong_key" in conf is not known to auth_token' 517 log = 'The option "wrong_key" is not known to keystonemiddleware'
518 auth_token.AuthProtocol(self.fake_app, conf) 518 auth_token.AuthProtocol(self.fake_app, conf)
519 self.assertThat(self.logger.output, matchers.Contains(log)) 519 self.assertThat(self.logger.output, matchers.Contains(log))
520 520