Merge "Align message serialization between drivers"
This commit is contained in:
commit
7734ac1376
@ -14,10 +14,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import json
|
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from oslo_serialization import jsonutils
|
||||||
from six import moves
|
from six import moves
|
||||||
|
|
||||||
import oslo_messaging
|
import oslo_messaging
|
||||||
@ -180,13 +180,11 @@ class FakeDriver(base.BaseDriver):
|
|||||||
def _check_serialize(message):
|
def _check_serialize(message):
|
||||||
"""Make sure a message intended for rpc can be serialized.
|
"""Make sure a message intended for rpc can be serialized.
|
||||||
|
|
||||||
We specifically want to use json, not our own jsonutils because
|
All the in tree drivers implementing RPC send uses jsonutils.dumps on
|
||||||
jsonutils has some extra logic to automatically convert objects to
|
the message. So in the test we ensure here that all the messages are
|
||||||
primitive types so that they can be serialized. We want to catch all
|
serializable with this call.
|
||||||
cases where non-primitive types make it into this code and treat it as
|
|
||||||
an error.
|
|
||||||
"""
|
"""
|
||||||
json.dumps(message)
|
jsonutils.dumps(message)
|
||||||
|
|
||||||
def _send(self, target, ctxt, message, wait_for_reply=None, timeout=None,
|
def _send(self, target, ctxt, message, wait_for_reply=None, timeout=None,
|
||||||
transport_options=None):
|
transport_options=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user