diff options
| author | Dan Prince <dan.prince@rackspace.com> | 2011-06-02 13:00:17 -0400 |
|---|---|---|
| committer | Dan Prince <dan.prince@rackspace.com> | 2011-06-02 13:00:17 -0400 |
| commit | 9034bb2fcd5f03df2b25d6114adc4e7d5f3549fe (patch) | |
| tree | ef5646c99a4de800196bfed8382e68b2fe178caa /nova | |
| parent | 052f08256d2be2dda5ed792be48aa4f97cb93a93 (diff) | |
Remove some of the extra image service calls from the OS API images controller.
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/api/openstack/images.py | 6 | ||||
| -rw-r--r-- | nova/tests/api/openstack/fakes.py | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py index 87cbef791..59d9e3082 100644 --- a/nova/api/openstack/images.py +++ b/nova/api/openstack/images.py @@ -94,8 +94,7 @@ class Controller(object): context = req.environ['nova.context'] try: - (image_service, image_id) = nova.image.get_image_service(id) - image = image_service.show(context, image_id) + image = self._image_service.show(context, id) except (exception.NotFound, exception.InvalidImageRef): explanation = _("Image not found.") raise faults.Fault(webob.exc.HTTPNotFound(explanation=explanation)) @@ -109,8 +108,7 @@ class Controller(object): :param id: Image identifier (integer) """ context = req.environ['nova.context'] - (image_service, image_id) = nova.image.get_image_service(id) - image_service.delete(context, image_id) + self._image_service.delete(context, id) return webob.exc.HTTPNoContent() def create(self, req, body): diff --git a/nova/tests/api/openstack/fakes.py b/nova/tests/api/openstack/fakes.py index 97fc3900d..17d6d591c 100644 --- a/nova/tests/api/openstack/fakes.py +++ b/nova/tests/api/openstack/fakes.py @@ -211,7 +211,7 @@ def stub_out_glance(stubs, initial_fixtures=None): def _find_image(self, image_id): for f in self.fixtures: - if f['id'] == image_id: + if str(f['id']) == str(image_id): return f return None |
