summaryrefslogtreecommitdiffstats
path: root/keystone/middleware
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2012-07-31 16:41:47 -0400
committerAdam Young <ayoung@redhat.com>2012-08-01 12:39:23 -0400
commitac4dcfd8f64dfe19d607b770eb98dd289498d3ac (patch)
tree732d65c2e24f7a7a31e9d70a9d7571675899d506 /keystone/middleware
parent2b2d0a15311fb1e9b6369374dfd5e0b49e4bf7a8 (diff)
downloadkeystone-ac4dcfd8f64dfe19d607b770eb98dd289498d3ac.tar.gz
keystone-ac4dcfd8f64dfe19d607b770eb98dd289498d3ac.tar.xz
keystone-ac4dcfd8f64dfe19d607b770eb98dd289498d3ac.zip
Use user home dir as default for cache
This is a better and safer default, as it and minimizes the possibility that the cache directory will be prepopulated or unwritable, while still providing a reasonable value for the individual developer Creates a better exception for failure to create the cache dir Logs the name of the cache dir actually used. Bug 1031022 Change-Id: Ia3718107e436ceb034e3a89318ac05265d66d6f1
Diffstat (limited to 'keystone/middleware')
-rw-r--r--keystone/middleware/auth_token.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/keystone/middleware/auth_token.py b/keystone/middleware/auth_token.py
index 3835f4c3..75ab67c7 100644
--- a/keystone/middleware/auth_token.py
+++ b/keystone/middleware/auth_token.py
@@ -117,6 +117,10 @@ class ServiceError(Exception):
pass
+class ConfigurationError(Exception):
+ pass
+
+
class AuthProtocol(object):
"""Auth Middleware that handles authenticating client calls."""
@@ -150,11 +154,14 @@ class AuthProtocol(object):
self.key_file = conf.get('keyfile')
#signing
- default_signing_dir = '/tmp/keystone-signing-%s' % os.environ['USER']
+ default_signing_dir = '%s/keystone-signing' % os.environ['HOME']
self.signing_dirname = conf.get('signing_dir', default_signing_dir)
+ LOG.info('Using %s as cache directory for signing certificate' %
+ self.signing_dirname)
if (os.path.exists(self.signing_dirname) and
not os.access(self.signing_dirname, os.W_OK)):
- raise "TODO: Need to find an Exception to raise here."
+ raise ConfigurationError("unable to access signing dir %s" %
+ self.signing_dirname)
if not os.path.exists(self.signing_dirname):
os.makedirs(self.signing_dirname)