~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to nova/auth/signer.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
    def s3_authorization(self, headers, verb, path):
79
79
        """Generate S3 authorization string."""
80
80
        if not boto:
81
 
            raise exception.Error('boto is not installed')
 
81
            raise exception.NovaException('boto is not installed')
82
82
        c_string = boto.utils.canonical_string(verb, path, headers)
83
83
        hmac_copy = self.hmac.copy()
84
84
        hmac_copy.update(c_string)
97
97
            return self._calc_signature_1(params)
98
98
        if params['SignatureVersion'] == '2':
99
99
            return self._calc_signature_2(params, verb, server_string, path)
100
 
        raise exception.Error('Unknown Signature Version: %s' %
 
100
        raise exception.NovaException('Unknown Signature Version: %s' %
101
101
                    params['SignatureVersion'])
102
102
 
103
103
    @staticmethod
140
140
        string_to_sign = '%s\n%s\n%s\n' % (verb, server_string, path)
141
141
 
142
142
        if 'SignatureMethod' not in params:
143
 
            raise exception.Error('No SignatureMethod specified')
 
143
            raise exception.NovaException('No SignatureMethod specified')
144
144
 
145
145
        if params['SignatureMethod'] == 'HmacSHA256':
146
146
            if not self.hmac_256:
147
 
                raise exception.Error('SHA256 not supported on this server')
 
147
                msg = _('SHA256 not supported on this server')
 
148
                raise exception.NovaException(msg)
148
149
            current_hmac = self.hmac_256
149
150
        elif params['SignatureMethod'] == 'HmacSHA1':
150
151
            current_hmac = self.hmac
151
152
        else:
152
 
            raise exception.Error('SignatureMethod %s not supported'
 
153
            raise exception.NovaException('SignatureMethod %s not supported'
153
154
                                  % params['SignatureMethod'])
154
155
 
155
156
        keys = params.keys()