aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-03-27 20:36:52 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-03-27 20:36:52 +0100
commit7158b76e649684342b3004bea0285357606d7c39 (patch)
tree2c339da31abdb892ab964cd2947c329595f7a506 /nixops/modules
parent24dbd8d2011aa3b13f81acd252d257652a9a9f9a (diff)
downloadNix-7158b76e649684342b3004bea0285357606d7c39.tar.gz
Nix-7158b76e649684342b3004bea0285357606d7c39.tar.zst
Nix-7158b76e649684342b3004bea0285357606d7c39.zip
Fix partial application in buildbot
Diffstat (limited to 'nixops/modules')
-rw-r--r--nixops/modules/buildbot/common/build_helpers.py7
1 files 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
81from buildbot.process import results 81from buildbot.process import results
82from twisted.words.protocols.jabber.jid import JID 82from twisted.words.protocols.jabber.jid import JID
83from wokkel import client, xmppim 83from wokkel import client, xmppim
84 84from functools import partial
85 85
86class SlackStatusPush(HttpStatusPushBase): 86class SlackStatusPush(HttpStatusPushBase):
87 name = "SlackStatusPush" 87 name = "SlackStatusPush"
@@ -206,16 +206,15 @@ class XMPPStatusPush(HttpStatusPushBase):
206 yield utils.getDetailsForBuild(self.master, build, wantProperties=True) 206 yield utils.getDetailsForBuild(self.master, build, wantProperties=True)
207 body = self.format(build) 207 body = self.format(build)
208 factory = client.DeferredClientFactory(JID("notify_bot@immae.fr/buildbot"), self.password) 208 factory = client.DeferredClientFactory(JID("notify_bot@immae.fr/buildbot"), self.password)
209 factory.streamManager.logTraffic = True
210 d = client.clientCreator(factory) 209 d = client.clientCreator(factory)
211 def send_message(stream): 210 def send_message(recipient, stream):
212 message = xmppim.Message(recipient=JID(recipient), body=body) 211 message = xmppim.Message(recipient=JID(recipient), body=body)
213 message.stanzaType = 'chat' 212 message.stanzaType = 'chat'
214 stream.send(message.toElement()) 213 stream.send(message.toElement())
215 # To allow chaining 214 # To allow chaining
216 return stream 215 return stream
217 for recipient in self.recipients: 216 for recipient in self.recipients:
218 d.addCallback(send_message) 217 d.addCallback(partial(send_message, recipient))
219 d.addCallback(lambda _: factory.streamManager.xmlstream.sendFooter()) 218 d.addCallback(lambda _: factory.streamManager.xmlstream.sendFooter())
220 d.addErrback(log.err) 219 d.addErrback(log.err)
221 220