]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Fix partial application in buildbot
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 27 Mar 2019 19:36:52 +0000 (20:36 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 27 Mar 2019 19:36:52 +0000 (20:36 +0100)
nixops/modules/buildbot/common/build_helpers.py

index 63733e7b31ec4b264eba8e62d46657c992940e1e..384b1ac34f895eed6342318f0fbc0be63af749af 100644 (file)
@@ -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)