diff options
| author | Alex Meade <alex.meade@rackspace.com> | 2012-05-03 14:29:50 -0400 |
|---|---|---|
| committer | Alex Meade <alex.meade@rackspace.com> | 2012-05-07 10:38:28 -0400 |
| commit | 2f552e957fddcd9e042a09a2d32d32fa564c18e7 (patch) | |
| tree | ba2914fb539f0143e90cb3fbb921cb67623f4762 /nova/auth | |
| parent | eb9e54c1129080ad0f5b569b39dfa09c539f2f11 (diff) | |
| download | nova-2f552e957fddcd9e042a09a2d32d32fa564c18e7.tar.gz nova-2f552e957fddcd9e042a09a2d32d32fa564c18e7.tar.xz nova-2f552e957fddcd9e042a09a2d32d32fa564c18e7.zip | |
Replaces exceptions.Error with NovaException
Fixes bug 817107
Change-Id: I6253e6bbcc44676c587b315fa32afba6459e676a
Diffstat (limited to 'nova/auth')
| -rw-r--r-- | nova/auth/manager.py | 2 | ||||
| -rw-r--r-- | nova/auth/signer.py | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/nova/auth/manager.py b/nova/auth/manager.py index 4f3787591..234b527bf 100644 --- a/nova/auth/manager.py +++ b/nova/auth/manager.py @@ -447,7 +447,7 @@ class AuthManager(object): """ if role == 'projectmanager': if not project: - raise exception.Error(_("Must specify project")) + raise exception.NovaException(_("Must specify project")) return self.is_project_manager(user, project) global_role = self._has_role(User.safe_id(user), diff --git a/nova/auth/signer.py b/nova/auth/signer.py index 1b351457b..05be34559 100644 --- a/nova/auth/signer.py +++ b/nova/auth/signer.py @@ -78,7 +78,7 @@ class Signer(object): def s3_authorization(self, headers, verb, path): """Generate S3 authorization string.""" if not boto: - raise exception.Error('boto is not installed') + raise exception.NovaException('boto is not installed') c_string = boto.utils.canonical_string(verb, path, headers) hmac_copy = self.hmac.copy() hmac_copy.update(c_string) @@ -97,7 +97,7 @@ class Signer(object): return self._calc_signature_1(params) if params['SignatureVersion'] == '2': return self._calc_signature_2(params, verb, server_string, path) - raise exception.Error('Unknown Signature Version: %s' % + raise exception.NovaException('Unknown Signature Version: %s' % params['SignatureVersion']) @staticmethod @@ -140,16 +140,17 @@ class Signer(object): string_to_sign = '%s\n%s\n%s\n' % (verb, server_string, path) if 'SignatureMethod' not in params: - raise exception.Error('No SignatureMethod specified') + raise exception.NovaException('No SignatureMethod specified') if params['SignatureMethod'] == 'HmacSHA256': if not self.hmac_256: - raise exception.Error('SHA256 not supported on this server') + msg = _('SHA256 not supported on this server') + raise exception.NovaException(msg) current_hmac = self.hmac_256 elif params['SignatureMethod'] == 'HmacSHA1': current_hmac = self.hmac else: - raise exception.Error('SignatureMethod %s not supported' + raise exception.NovaException('SignatureMethod %s not supported' % params['SignatureMethod']) keys = params.keys() |
