aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/buildbot
diff options
context:
space:
mode:
Diffstat (limited to 'nixops/modules/buildbot')
-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