Fix using anyjson in fake_notifier

For some reason we were using anyjson.serialize() in our fake_notifier.
That may have been to mirror kombu, but really we need to mirror what we
do when we convert our payloads to primitives, which is using jsonutils.

Closes-Bug: #1403162
Change-Id: I92a4708e0700e88f4b2554aa4e7ad3856f5be1e0
This commit is contained in:
Dan Smith
2014-12-16 10:19:56 -08:00
committed by Dan Smith
parent ebbb56e297
commit 7ed9268a1f

View File

@@ -15,8 +15,8 @@
import collections
import functools
import anyjson
from oslo import messaging
from oslo.serialization import jsonutils
from nova import rpc
@@ -54,7 +54,7 @@ class FakeNotifier(object):
# NOTE(sileht): simulate the kombu serializer
# this permit to raise an exception if something have not
# been serialized correctly
anyjson.serialize(payload)
jsonutils.to_primitive(payload)
msg = FakeMessage(self.publisher_id, priority, event_type, payload)
NOTIFICATIONS.append(msg)