From 7158b76e649684342b3004bea0285357606d7c39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 27 Mar 2019 20:36:52 +0100 Subject: [PATCH] Fix partial application in buildbot --- nixops/modules/buildbot/common/build_helpers.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nixops/modules/buildbot/common/build_helpers.py b/nixops/modules/buildbot/common/build_helpers.py index 63733e7..384b1ac 100644 --- a/nixops/modules/buildbot/common/build_helpers.py +++ b/nixops/modules/buildbot/common/build_helpers.py @@ -81,7 +81,7 @@ from buildbot.reporters import utils from buildbot.process import results from twisted.words.protocols.jabber.jid import JID from wokkel import client, xmppim - +from functools import partial class SlackStatusPush(HttpStatusPushBase): name = "SlackStatusPush" @@ -206,16 +206,15 @@ class XMPPStatusPush(HttpStatusPushBase): yield utils.getDetailsForBuild(self.master, build, wantProperties=True) body = self.format(build) factory = client.DeferredClientFactory(JID("notify_bot@immae.fr/buildbot"), self.password) - factory.streamManager.logTraffic = True d = client.clientCreator(factory) - def send_message(stream): + def send_message(recipient, stream): message = xmppim.Message(recipient=JID(recipient), body=body) message.stanzaType = 'chat' stream.send(message.toElement()) # To allow chaining return stream for recipient in self.recipients: - d.addCallback(send_message) + d.addCallback(partial(send_message, recipient)) d.addCallback(lambda _: factory.streamManager.xmlstream.sendFooter()) d.addErrback(log.err) -- 2.41.0