diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-03-27 20:36:52 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-03-27 20:36:52 +0100 |
commit | 7158b76e649684342b3004bea0285357606d7c39 (patch) | |
tree | 2c339da31abdb892ab964cd2947c329595f7a506 /nixops/modules | |
parent | 24dbd8d2011aa3b13f81acd252d257652a9a9f9a (diff) | |
download | Nix-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.py | 7 |
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 | |||
81 | from buildbot.process import results | 81 | from buildbot.process import results |
82 | from twisted.words.protocols.jabber.jid import JID | 82 | from twisted.words.protocols.jabber.jid import JID |
83 | from wokkel import client, xmppim | 83 | from wokkel import client, xmppim |
84 | 84 | from functools import partial | |
85 | 85 | ||
86 | class SlackStatusPush(HttpStatusPushBase): | 86 | class 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 | ||