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

« back to all changes in this revision

Viewing changes to nova/api/ec2/__init__.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:
37
37
from nova import flags
38
38
from nova import log as logging
39
39
from nova.openstack.common import cfg
 
40
from nova.openstack.common import importutils
 
41
from nova.openstack.common import jsonutils
40
42
from nova import utils
41
43
from nova import wsgi
42
44
 
225
227
                                        'path': req.path,
226
228
                                        'params': auth_params,
227
229
                                       }}}
228
 
        creds_json = utils.dumps(creds)
 
230
        creds_json = jsonutils.dumps(creds)
229
231
        headers = {'Content-Type': 'application/json'}
230
232
 
231
233
        # Disable "has no x member" pylint error
244
246
        #             having keystone return token, tenant,
245
247
        #             user, and roles from this call.
246
248
 
247
 
        result = utils.loads(response)
 
249
        result = jsonutils.loads(response)
248
250
        try:
249
251
            token_id = result['access']['token']['id']
250
252
        except (AttributeError, KeyError), e:
288
290
            creds = {'ec2Credentials': cred_dict}
289
291
        else:
290
292
            creds = {'auth': {'OS-KSEC2:ec2Credentials': cred_dict}}
291
 
        creds_json = utils.dumps(creds)
 
293
        creds_json = jsonutils.dumps(creds)
292
294
        headers = {'Content-Type': 'application/json'}
293
295
 
294
296
        o = urlparse.urlparse(FLAGS.keystone_ec2_url)
305
307
            else:
306
308
                msg = _("Failure communicating with keystone")
307
309
            return ec2_error(req, request_id, "Unauthorized", msg)
308
 
        result = utils.loads(data)
 
310
        result = jsonutils.loads(data)
309
311
        conn.close()
310
312
 
311
313
        try:
410
412
 
411
413
    def __init__(self, app, controller):
412
414
        super(Requestify, self).__init__(app)
413
 
        self.controller = utils.import_class(controller)()
 
415
        self.controller = importutils.import_object(controller)
414
416
 
415
417
    @webob.dec.wsgify(RequestClass=wsgi.Request)
416
418
    def __call__(self, req):
644
646
                    env.pop(k)
645
647
 
646
648
            LOG.exception(_('Unexpected error raised: %s'), unicode(ex))
647
 
            LOG.error(_('Environment: %s') % utils.dumps(env))
 
649
            LOG.error(_('Environment: %s') % jsonutils.dumps(env))
648
650
            return ec2_error(req, request_id, 'UnknownError',
649
651
                             _('An unknown error has occurred. '
650
652
                               'Please try your request again.'))