summaryrefslogtreecommitdiffstats
path: root/openstack
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2013-06-25 07:12:21 +0100
committerMark McLoughlin <markmc@redhat.com>2013-06-25 07:12:21 +0100
commit13650b13ddd535481a0112de9c2ffcb7a2996b11 (patch)
tree984a5b5da9e32504dd12c51749d42a6f78bbbf52 /openstack
parentbc10b7aeada4ea66e85e10b94b5c219e3c8d2e77 (diff)
downloadoslo-13650b13ddd535481a0112de9c2ffcb7a2996b11.tar.gz
oslo-13650b13ddd535481a0112de9c2ffcb7a2996b11.tar.xz
oslo-13650b13ddd535481a0112de9c2ffcb7a2996b11.zip
rpc: remove some unused serialization code
The first commit of Nova contains this code as https://github.com/openstack/nova/blob/bf6e6e7/nova/rpc.py#L149 try: publisher.send({'result': reply}) except TypeError: publisher.send( {'result': dict((k, repr(v)) for k, v in reply.__dict__.iteritems()) }) but when the kombu driver was first added, it became: https://github.com/openstack/nova/blob/9cb46c48/nova/rpc/impl_kombu.py#L717 try: msg = {'result': reply, 'failure': failure} except TypeError: msg = {'result': dict((k, repr(v)) for k, v in reply.__dict__.iteritems()), 'failure': failure} conn.direct_send(msg_id, msg) Obviously, TypeError can't be raised with the current code and we dump everything to json these days before passing down to kombu, qpid, etc. Change-Id: I932fbfbbe824fbd9de8d31f070878e9db853ee45
Diffstat (limited to 'openstack')
-rw-r--r--openstack/common/rpc/amqp.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/openstack/common/rpc/amqp.py b/openstack/common/rpc/amqp.py
index 1ab7ae4..c3e4e26 100644
--- a/openstack/common/rpc/amqp.py
+++ b/openstack/common/rpc/amqp.py
@@ -221,12 +221,7 @@ def msg_reply(conf, msg_id, reply_q, connection_pool, reply=None,
failure = rpc_common.serialize_remote_exception(failure,
log_failure)
- try:
- msg = {'result': reply, 'failure': failure}
- except TypeError:
- msg = {'result': dict((k, repr(v))
- for k, v in reply.__dict__.iteritems()),
- 'failure': failure}
+ msg = {'result': reply, 'failure': failure}
if ending:
msg['ending'] = True
_add_unique_id(msg)