summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc/impl_zmq.py
diff options
context:
space:
mode:
authorEric Windisch <eric@cloudscaling.com>2012-12-12 22:19:18 -0500
committerEric Windisch <eric@cloudscaling.com>2013-01-08 13:10:44 -0500
commit1e6b9b7bc7ed3430c442c6bc075ec541850f495d (patch)
treede10e962313ff4c6bde5ff35763cc71a230476f3 /openstack/common/rpc/impl_zmq.py
parent91c9631bd3e3a0c72b36840ddf90e1db483f9a14 (diff)
downloadoslo-1e6b9b7bc7ed3430c442c6bc075ec541850f495d.tar.gz
oslo-1e6b9b7bc7ed3430c442c6bc075ec541850f495d.tar.xz
oslo-1e6b9b7bc7ed3430c442c6bc075ec541850f495d.zip
rpc method arguments should be dict, not list
default arguments were being set to a list instead of a dict. This caused problems if the args key was missing in the msg argument to the call/cast methods. Adds tests to check if RPC cast/call work without arguments. Changes and documents the _test_cast method arguments, allowing for more flexibility and code reuse. fixes bug 1089750 Change-Id: I854dc3fcad8936695feb4414f3862672cf98c5d1
Diffstat (limited to 'openstack/common/rpc/impl_zmq.py')
-rw-r--r--openstack/common/rpc/impl_zmq.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py
index 33562b0..85c5fe5 100644
--- a/openstack/common/rpc/impl_zmq.py
+++ b/openstack/common/rpc/impl_zmq.py
@@ -250,7 +250,7 @@ class InternalContext(object):
"""Process a curried message and cast the result to topic."""
LOG.debug(_("Running func with context: %s"), ctx.to_dict())
data.setdefault('version', None)
- data.setdefault('args', [])
+ data.setdefault('args', {})
try:
result = proxy.dispatch(
@@ -321,7 +321,7 @@ class ConsumerBase(object):
return
data.setdefault('version', None)
- data.setdefault('args', [])
+ data.setdefault('args', {})
proxy.dispatch(ctx, data['version'],
data['method'], **data['args'])