diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-03-08 22:24:56 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-03-08 22:24:56 +0000 |
commit | d6722fe5974a2a25915e167d4550e0aa3d0d6330 (patch) | |
tree | 3e75791c3596a6153c5d2d91ed48141cdf5cd424 /keystone/token | |
parent | a2c3636bfdebc3af3738e87fc2295dc3845913d2 (diff) | |
parent | b1474da1413b0334b8975875ebb584df8a1342f5 (diff) | |
download | keystone-d6722fe5974a2a25915e167d4550e0aa3d0d6330.tar.gz keystone-d6722fe5974a2a25915e167d4550e0aa3d0d6330.tar.xz keystone-d6722fe5974a2a25915e167d4550e0aa3d0d6330.zip |
Merge "unable to load certificate should abort request"
Diffstat (limited to 'keystone/token')
-rw-r--r-- | keystone/token/controllers.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/keystone/token/controllers.py b/keystone/token/controllers.py index ade2af4f..4474deaa 100644 --- a/keystone/token/controllers.py +++ b/keystone/token/controllers.py @@ -1,4 +1,5 @@ import json +import subprocess import uuid from keystone.common import cms @@ -114,13 +115,17 @@ class Auth(controller.V2Controller): if CONF.signing.token_format == 'UUID': token_id = uuid.uuid4().hex elif CONF.signing.token_format == 'PKI': - token_id = cms.cms_sign_token(json.dumps(token_data), - CONF.signing.certfile, - CONF.signing.keyfile) + try: + token_id = cms.cms_sign_token(json.dumps(token_data), + CONF.signing.certfile, + CONF.signing.keyfile) + except subprocess.CalledProcessError: + raise exception.UnexpectedError(_( + 'Unable to sign token.')) else: - raise exception.UnexpectedError( + raise exception.UnexpectedError(_( 'Invalid value for token_format: %s.' - ' Allowed values are PKI or UUID.' % + ' Allowed values are PKI or UUID.') % CONF.signing.token_format) try: self.token_api.create_token( |