summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2015-02-26 08:57:46 -0500
committerMonty Taylor <mordred@inaugust.com>2015-03-01 09:45:32 -0500
commit1ccad8c41c9cab2f577e6505daab858a2c9d22b5 (patch)
tree8f03ab2f380ea9aef7808f37a6868813927e7791
parent7385528671ea61617d7027fc33897ea850e7364c (diff)
downloados-client-config-1ccad8c41c9cab2f577e6505daab858a2c9d22b5.tar.gz
Add support for configuring dogpile.cache
shade has added dogpile.cache support. Since os-client-config already supports processing global cache settings, go ahead and add support for a couple of settings that can be used to feed dogpile.cache. Change-Id: I4d40753b83041c8a48b5c0a6d446f9e0de68220a
-rw-r--r--os_client_config/config.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py
index f8adc04..83ec6c4 100644
--- a/os_client_config/config.py
+++ b/os_client_config/config.py
@@ -88,11 +88,17 @@ class OpenStackConfig(object):
self._cache_max_age = 300
self._cache_path = CACHE_PATH
+ self._cache_class = 'dogpile.cache.memory'
+ self._cache_arguments = {}
if 'cache' in self.cloud_config:
self._cache_max_age = self.cloud_config['cache'].get(
'max_age', self._cache_max_age)
self._cache_path = os.path.expanduser(
self.cloud_config['cache'].get('path', self._cache_path))
+ self._cache_class = self.cloud_config['cache'].get(
+ 'class', self._cache_class)
+ self._cache_arguments = self.cloud_config['cache'].get(
+ 'arguments', self._cache_arguments)
def _load_config_file(self):
for path in self._config_files:
@@ -112,6 +118,12 @@ class OpenStackConfig(object):
def get_cache_path(self):
return self._cache_path
+ def get_cache_class(self):
+ return self._cache_class
+
+ def get_cache_arguments(self):
+ return self._cache_arguments
+
def _get_regions(self, cloud):
try:
return self.cloud_config['clouds'][cloud]['region_name']