Add serialization of context to FakeNotifier
Currently, the FakeNotifier doesn't do anything to check the context that will be serialized when the RPC call is made. This change adds a call to serialize the context to prevent bugs related to the context passed in to send the notification. Related-Bug: #1360911 Change-Id: I905f8421bc8e34c52b779d65a88d1ebf044f4dd1
This commit is contained in:
parent
7135af61c1
commit
26e1caa175
|
@ -55,6 +55,10 @@ class FakeNotifier(object):
|
|||
# this permit to raise an exception if something have not
|
||||
# been serialized correctly
|
||||
jsonutils.to_primitive(payload)
|
||||
# NOTE(melwitt): Try to serialize the context, as the rpc would.
|
||||
# An exception will be raised if something is wrong
|
||||
# with the context.
|
||||
self._serializer.serialize_context(ctxt)
|
||||
msg = FakeMessage(self.publisher_id, priority, event_type,
|
||||
payload, ctxt)
|
||||
NOTIFICATIONS.append(msg)
|
||||
|
|
Loading…
Reference in New Issue