~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/api/openstack/images.py

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-12-13 10:17:01 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20101213101701-txhhqbzsxw4avnxv
Tags: upstream-2011.1~bzr456
ImportĀ upstreamĀ versionĀ 2011.1~bzr456

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from webob import exc
19
19
 
20
 
from nova import context
21
20
from nova import flags
22
21
from nova import utils
23
22
from nova import wsgi
47
46
 
48
47
    def detail(self, req):
49
48
        """Return all public images in detail."""
50
 
        user_id = req.environ['nova.context']['user']['id']
51
 
        ctxt = context.RequestContext(user_id, user_id)
52
49
        try:
53
 
            images = self._service.detail(ctxt)
 
50
            images = self._service.detail(req.environ['nova.context'])
54
51
            images = nova.api.openstack.limited(images, req)
55
52
        except NotImplementedError:
56
53
            # Emulate detail() using repeated calls to show()
61
58
 
62
59
    def show(self, req, id):
63
60
        """Return data about the given image id."""
64
 
        user_id = req.environ['nova.context']['user']['id']
65
 
        ctxt = context.RequestContext(user_id, user_id)
66
 
        return dict(image=self._service.show(ctxt, id))
 
61
        return dict(image=self._service.show(req.environ['nova.context'], id))
67
62
 
68
63
    def delete(self, req, id):
69
64
        # Only public images are supported for now.