From 57e96c422e18bf359c8d05ff97a738ca4c782afe Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Fri, 3 Mar 2017 07:00:36 -0500 Subject: [PATCH] Make fake MBS messages JSON serializable. Which prevents errors when fedmsg-hub tries to checkpoint its progress on disk in prod. --- module_build_service/messaging.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module_build_service/messaging.py b/module_build_service/messaging.py index 480ea13e..61ecc549 100644 --- a/module_build_service/messaging.py +++ b/module_build_service/messaging.py @@ -78,6 +78,9 @@ class BaseMessage(object): """ Used to trick moksha into thinking we are a dict. """ return getattr(self, key, value) + def __json__(self): + return dict(msg_id=self.msg_id, topic=self.topic, body=self.body) + @staticmethod def from_amq(topic, msg): msg_obj = None