From 821c90e61330fe97675fd8c95532e75fc18364af Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 30 2019 14:13:54 +0000 Subject: Rework the imports in fedmsgshim Basically, we were importing publish from the fedora-messaging API, but the method in this module is also named publish which led to conflicts in function name and the wrong one was called out. This results in no messages being sent. Signed-off-by: Pierre-Yves Chibon --- diff --git a/fedora_elections/fedmsgshim.py b/fedora_elections/fedmsgshim.py index 6eb365c..1285b34 100644 --- a/fedora_elections/fedmsgshim.py +++ b/fedora_elections/fedmsgshim.py @@ -8,7 +8,7 @@ import warnings import logging -from fedora_messaging.api import Message, publish +import fedora_messaging.api from fedora_messaging.exceptions import PublishReturned, ConnectionException @@ -18,11 +18,11 @@ _log = logging.getLogger(__name__) def publish(topic, msg): # pragma: no cover _log.debug('Publishing a message for %r: %s', topic, msg) try: - message = Message( + message = fedora_messaging.api.Message( topic='fedora_elections.%s' % topic, body=msg ) - publish(message) + fedora_messaging.api.publish(message) except PublishReturned as e: _log.exception( 'Fedora Messaging broker rejected message %s: %s',