diff options
| author | jaypipes@gmail.com <> | 2010-10-13 16:17:23 -0400 |
|---|---|---|
| committer | jaypipes@gmail.com <> | 2010-10-13 16:17:23 -0400 |
| commit | 52600e6bee170ac6d78eff004ecc98394c43ff6f (patch) | |
| tree | 8b740736329862bc066381d7924f965ac016ba37 /nova/api | |
| parent | 088bd29f53eaac48574fa59c251b3564a380d4d9 (diff) | |
Adds unit test for WSGI image controller for OpenStack API using Glance Service.
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/images.py | 9 |
1 files changed, 7 insertions, 2 deletions
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): |
