From: Ismaƫl Bouya Date: Wed, 27 Mar 2019 19:36:52 +0000 (+0100) Subject: Fix partial application in buildbot X-Git-Tag: nur_publish~185 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=7158b76e649684342b3004bea0285357606d7c39;hp=24dbd8d2011aa3b13f81acd252d257652a9a9f9a;p=perso%2FImmae%2FConfig%2FNix.git Fix partial application in buildbot --- 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)