diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-06-13 20:26:10 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-06-13 20:26:10 +0000 |
| commit | 9eb2b52946be78428f6ee565f8b29e6ee9102a8c (patch) | |
| tree | 510f1eb68d4853c2f4e6ea7a8ad3192d279cb67d /nova/api | |
| parent | 06591f13dcf130d8fb035466bfbe5650acfddb28 (diff) | |
| parent | befc7bcc88547916ab59d5fec5e8dd6e01ccf49f (diff) | |
| download | nova-9eb2b52946be78428f6ee565f8b29e6ee9102a8c.tar.gz nova-9eb2b52946be78428f6ee565f8b29e6ee9102a8c.tar.xz nova-9eb2b52946be78428f6ee565f8b29e6ee9102a8c.zip | |
- fixes bug that prevented custom wsgi serialization
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/wsgi.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 6760735c4..b0e2cab2c 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -60,7 +60,7 @@ class TextDeserializer(object): def deserialize(self, datastring, action='default'): """Find local deserialization method and parse request body.""" - action_method = getattr(self, action, self.default) + action_method = getattr(self, str(action), self.default) return action_method(datastring) def default(self, datastring): @@ -189,7 +189,7 @@ class DictSerializer(object): def serialize(self, data, action='default'): """Find local serialization method and encode response body.""" - action_method = getattr(self, action, self.default) + action_method = getattr(self, str(action), self.default) return action_method(data) def default(self, data): @@ -296,7 +296,7 @@ class ResponseSerializer(object): } self.serializers.update(serializers or {}) - def serialize(self, response_data, content_type): + def serialize(self, response_data, content_type, action='default'): """Serialize a dict into a string and wrap in a wsgi.Request object. :param response_data: dict produced by the Controller @@ -307,7 +307,7 @@ class ResponseSerializer(object): response.headers['Content-Type'] = content_type serializer = self.get_serializer(content_type) - response.body = serializer.serialize(response_data) + response.body = serializer.serialize(response_data, action) return response @@ -358,7 +358,7 @@ class Resource(wsgi.Application): #TODO(bcwaldon): find a more elegant way to pass through non-dict types if type(action_result) is dict: - response = self.serializer.serialize(action_result, accept) + response = self.serializer.serialize(action_result, accept, action) else: response = action_result |
