Update openstack-common files.
The RPC support requires that the fanout_cast messages enable the application to set the topic. This was fixed in https://review.openstack.org/#/c/10125/. In addition to this the jsonutils.py was updated. Change-Id: I85b5a3a74f129746528910d12acdd00db39d8626
This commit is contained in:
parent
a01ca27a88
commit
f43b1cede9
@ -107,9 +107,11 @@ def to_primitive(value, convert_instances=False, level=0):
|
|||||||
elif hasattr(value, 'iteritems'):
|
elif hasattr(value, 'iteritems'):
|
||||||
return to_primitive(dict(value.iteritems()),
|
return to_primitive(dict(value.iteritems()),
|
||||||
convert_instances=convert_instances,
|
convert_instances=convert_instances,
|
||||||
level=level)
|
level=level + 1)
|
||||||
elif hasattr(value, '__iter__'):
|
elif hasattr(value, '__iter__'):
|
||||||
return to_primitive(list(value), level)
|
return to_primitive(list(value),
|
||||||
|
convert_instances=convert_instances,
|
||||||
|
level=level)
|
||||||
elif convert_instances and hasattr(value, '__dict__'):
|
elif convert_instances and hasattr(value, '__dict__'):
|
||||||
# Likely an instance of something. Watch for cycles.
|
# Likely an instance of something. Watch for cycles.
|
||||||
# Ignore class member vars.
|
# Ignore class member vars.
|
||||||
|
@ -112,11 +112,12 @@ class RpcProxy(object):
|
|||||||
self._set_version(msg, version)
|
self._set_version(msg, version)
|
||||||
rpc.cast(context, self._get_topic(topic), msg)
|
rpc.cast(context, self._get_topic(topic), msg)
|
||||||
|
|
||||||
def fanout_cast(self, context, msg, version=None):
|
def fanout_cast(self, context, msg, topic=None, version=None):
|
||||||
"""rpc.fanout_cast() a remote method.
|
"""rpc.fanout_cast() a remote method.
|
||||||
|
|
||||||
:param context: The request context
|
:param context: The request context
|
||||||
:param msg: The message to send, including the method and args.
|
:param msg: The message to send, including the method and args.
|
||||||
|
:param topic: Override the topic for this message.
|
||||||
:param version: (Optional) Override the requested API version in this
|
:param version: (Optional) Override the requested API version in this
|
||||||
message.
|
message.
|
||||||
|
|
||||||
@ -124,7 +125,7 @@ class RpcProxy(object):
|
|||||||
from the remote method.
|
from the remote method.
|
||||||
"""
|
"""
|
||||||
self._set_version(msg, version)
|
self._set_version(msg, version)
|
||||||
rpc.fanout_cast(context, self.topic, msg)
|
rpc.fanout_cast(context, self._get_topic(topic), msg)
|
||||||
|
|
||||||
def cast_to_server(self, context, server_params, msg, topic=None,
|
def cast_to_server(self, context, server_params, msg, topic=None,
|
||||||
version=None):
|
version=None):
|
||||||
@ -144,13 +145,15 @@ class RpcProxy(object):
|
|||||||
self._set_version(msg, version)
|
self._set_version(msg, version)
|
||||||
rpc.cast_to_server(context, server_params, self._get_topic(topic), msg)
|
rpc.cast_to_server(context, server_params, self._get_topic(topic), msg)
|
||||||
|
|
||||||
def fanout_cast_to_server(self, context, server_params, msg, version=None):
|
def fanout_cast_to_server(self, context, server_params, msg, topic=None,
|
||||||
|
version=None):
|
||||||
"""rpc.fanout_cast_to_server() a remote method.
|
"""rpc.fanout_cast_to_server() a remote method.
|
||||||
|
|
||||||
:param context: The request context
|
:param context: The request context
|
||||||
:param server_params: Server parameters. See rpc.cast_to_server() for
|
:param server_params: Server parameters. See rpc.cast_to_server() for
|
||||||
details.
|
details.
|
||||||
:param msg: The message to send, including the method and args.
|
:param msg: The message to send, including the method and args.
|
||||||
|
:param topic: Override the topic for this message.
|
||||||
:param version: (Optional) Override the requested API version in this
|
:param version: (Optional) Override the requested API version in this
|
||||||
message.
|
message.
|
||||||
|
|
||||||
@ -158,4 +161,5 @@ class RpcProxy(object):
|
|||||||
return values.
|
return values.
|
||||||
"""
|
"""
|
||||||
self._set_version(msg, version)
|
self._set_version(msg, version)
|
||||||
rpc.fanout_cast_to_server(context, server_params, self.topic, msg)
|
rpc.fanout_cast_to_server(context, server_params,
|
||||||
|
self._get_topic(topic), msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user