diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-06-13 15:03:26 -0400 |
|---|---|---|
| committer | Brian Waldon <brian.waldon@rackspace.com> | 2011-06-13 15:03:26 -0400 |
| commit | f2ca12fc5ea236bb8940acce80065a3bcbe37d2a (patch) | |
| tree | 30d2c3c0fccdf049149e9085eed3b81224b04c96 /nova/api | |
| parent | 8146b92f7d81eada6408f939ef25cb5393650008 (diff) | |
| download | nova-f2ca12fc5ea236bb8940acce80065a3bcbe37d2a.tar.gz nova-f2ca12fc5ea236bb8940acce80065a3bcbe37d2a.tar.xz nova-f2ca12fc5ea236bb8940acce80065a3bcbe37d2a.zip | |
wsgi can now handle dispatching action None more elegantly
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/wsgi.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index e71b80e2c..385ae4625 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -60,8 +60,9 @@ class TextDeserializer(object): def deserialize(self, datastring, action='default'): """Find local deserialization method and parse request body.""" - action_method = getattr(self, action, self.default) - return action_method(datastring) + action_method = getattr(self, str(action), self.default) + output = action_method(datastring) + return output def default(self, datastring): """Default deserialization code should live here""" @@ -189,11 +190,9 @@ class DictSerializer(object): def serialize(self, data, action='default'): """Find local serialization method and encode response body.""" - if action is None: - action_method = self.default - else: - action_method = getattr(self, action, self.default) - return action_method(data) + action_method = getattr(self, str(action), self.default) + output = action_method(data) + return output def default(self, data): """Default serialization code should live here""" |
