From 4531809d600b8dda1732410fb762751bcc51f4cb Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Fri, 8 Dec 2017 09:56:31 +0100 Subject: [PATCH] cfg.CONF must not be used directly cfg.CONF must not be used directly, Config().oslo_conf_obj must be used instead. Closes-bug: #1737119 Change-Id: I58ec9e25c7f04a8352535d8861e09c7e4c4c0a9d --- keystonemiddleware/auth_token/__init__.py | 5 +++-- releasenotes/notes/bug-1737119-4afe548d28fbf8bb.yaml | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/bug-1737119-4afe548d28fbf8bb.yaml diff --git a/keystonemiddleware/auth_token/__init__.py b/keystonemiddleware/auth_token/__init__.py index 9e84c951..67668185 100644 --- a/keystonemiddleware/auth_token/__init__.py +++ b/keystonemiddleware/auth_token/__init__.py @@ -559,6 +559,8 @@ class AuthProtocol(BaseAuthProtocol): _base.AUTHTOKEN_GROUP, list_opts(), conf) + if self._conf.oslo_conf_obj != cfg.CONF: + oslo_cache.configure(self._conf.oslo_conf_obj) token_roles_required = self._conf.get('service_token_roles_required') @@ -957,9 +959,8 @@ class AuthProtocol(BaseAuthProtocol): def _create_oslo_cache(self): # having this as a function makes test mocking easier - conf = cfg.CONF region = oslo_cache.create_region() - oslo_cache.configure_cache_region(conf, region) + oslo_cache.configure_cache_region(self._conf.oslo_conf_obj, region) return region def _token_cache_factory(self): diff --git a/releasenotes/notes/bug-1737119-4afe548d28fbf8bb.yaml b/releasenotes/notes/bug-1737119-4afe548d28fbf8bb.yaml new file mode 100644 index 00000000..052df07c --- /dev/null +++ b/releasenotes/notes/bug-1737119-4afe548d28fbf8bb.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - > + [`bug 1737119 `_] + If the application was not using the global cfg.CONF object, the configuration + was not read from the configuration file. This have been fixed.