diff options
| author | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-08-23 12:46:29 -0400 |
|---|---|---|
| committer | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-08-23 12:46:29 -0400 |
| commit | 030d01fd10f7f65cdafbea49e04f3b6b147a7348 (patch) | |
| tree | 14ed74ab39d19983cb03048bde1554689729d997 | |
| parent | e3727d6d88a0631d3b896c4fcdcfec05510dad36 (diff) | |
| download | nova-030d01fd10f7f65cdafbea49e04f3b6b147a7348.tar.gz nova-030d01fd10f7f65cdafbea49e04f3b6b147a7348.tar.xz nova-030d01fd10f7f65cdafbea49e04f3b6b147a7348.zip | |
Serialize properly
| -rw-r--r-- | nova/api/rackspace/base.py | 3 | ||||
| -rw-r--r-- | nova/api/rackspace/images.py | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/nova/api/rackspace/base.py b/nova/api/rackspace/base.py index c85fd7b8e..b995d9acc 100644 --- a/nova/api/rackspace/base.py +++ b/nova/api/rackspace/base.py @@ -36,4 +36,5 @@ class Controller(wsgi.Controller): MIME types to information needed to serialize to that type. """ _metadata = getattr(type(self), "_serialization_metadata", {}) - return Serializer(request.environ, _metadata).to_content_type(data) + serializer = wsgi.Serializer(request.environ, _metadata) + return serializer.to_content_type(data) diff --git a/nova/api/rackspace/images.py b/nova/api/rackspace/images.py index c9cc8e85d..62e0b24c5 100644 --- a/nova/api/rackspace/images.py +++ b/nova/api/rackspace/images.py @@ -56,12 +56,12 @@ class Controller(base.Controller): """Return all public images.""" data = dict((self._to_rs_id(id), val) for id, val in self._svc.index().iteritems()) - return dict(images=data) + return self.serialize(dict(images=data), req) def show(self, req, id): """Return data about the given image id.""" opaque_id = self._from_rs_id(id) - return dict(image=self._svc.show(opaque_id)) + return self.serialize(dict(image=self._svc.show(opaque_id)), req) def delete(self, req, id): # Only public images are supported for now. |
