From 52600e6bee170ac6d78eff004ecc98394c43ff6f Mon Sep 17 00:00:00 2001 From: "jaypipes@gmail.com" <> Date: Wed, 13 Oct 2010 16:17:23 -0400 Subject: Adds unit test for WSGI image controller for OpenStack API using Glance Service. --- nova/api/openstack/images.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py index aa438739c..5f2d71dc2 100644 --- a/nova/api/openstack/images.py +++ b/nova/api/openstack/images.py @@ -48,8 +48,13 @@ class Controller(wsgi.Controller): def detail(self, req): """Return all public images in detail.""" - data = self._service.index() - data = nova.api.openstack.limited(data, req) + try: + data = self._service.detail() + except NotImplementedError: + # Emulate detail() using repeated calls to show() + images = self._service.index() + images = nova.api.openstack.limited(images, req) + data = [self._service.show(i['id']) for i in images] return dict(images=data) def show(self, req, id): -- cgit