summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-09-30 09:26:11 +0000
committerGerrit Code Review <review@openstack.org>2019-09-30 09:26:11 +0000
commit7734ac1376a1a9285c8245a91cf43599358bfa9d (patch)
tree51325bb31c788c6d2bff7da7667a898d29edf608
parentb72922670fdffd05d3c547fbb8707704ab73a5dc (diff)
parentd8980bfed8621eadce36c6a56944ca23245187a6 (diff)
downloadoslo-messaging-7734ac1376a1a9285c8245a91cf43599358bfa9d.tar.gz
Merge "Align message serialization between drivers"
-rw-r--r--oslo_messaging/_drivers/impl_fake.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/oslo_messaging/_drivers/impl_fake.py b/oslo_messaging/_drivers/impl_fake.py
index 05300e7..c5476fd 100644
--- a/oslo_messaging/_drivers/impl_fake.py
+++ b/oslo_messaging/_drivers/impl_fake.py
@@ -14,10 +14,10 @@
# under the License.
import copy
-import json
import threading
import time
+from oslo_serialization import jsonutils
from six import moves
import oslo_messaging
@@ -180,13 +180,11 @@ class FakeDriver(base.BaseDriver):
def _check_serialize(message):
"""Make sure a message intended for rpc can be serialized.
- We specifically want to use json, not our own jsonutils because
- jsonutils has some extra logic to automatically convert objects to
- primitive types so that they can be serialized. We want to catch all
- cases where non-primitive types make it into this code and treat it as
- an error.
+ All the in tree drivers implementing RPC send uses jsonutils.dumps on
+ the message. So in the test we ensure here that all the messages are
+ serializable with this call.
"""
- json.dumps(message)
+ jsonutils.dumps(message)
def _send(self, target, ctxt, message, wait_for_reply=None, timeout=None,
transport_options=None):