[Buildbot-commits] buildbot/buildbot/clients sendchange.py,1.1,1.2

Brian Warner warner at users.sourceforge.net
Wed May 4 07:37:29 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot/clients
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32364/buildbot/clients

Modified Files:
	sendchange.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-135
Creator:  Brian Warner <warner at monolith.lothar.com>

sendchange: tear down the PB connection after sending the change

	* buildbot/clients/sendchange.py (Sender.send): tear down the PB
	connection after sending the change, so that unit tests don't
	complain about sockets being left around


Index: sendchange.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/clients/sendchange.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sendchange.py	4 May 2005 02:09:39 -0000	1.1
+++ sendchange.py	4 May 2005 07:37:27 -0000	1.2
@@ -17,7 +17,12 @@
         f = pb.PBClientFactory()
         d = f.login(credentials.UsernamePassword("change", "changepw"))
         reactor.connectTCP(self.host, self.port, f)
-        d.addCallback(lambda remote: remote.callRemote('addChange', change))
+        d.addCallback(self.addChange, change)
+        return d
+
+    def addChange(self, remote, change):
+        d = remote.callRemote('addChange', change)
+        d.addCallback(lambda res: remote.broker.transport.loseConnection())
         return d
 
     def printSuccess(self, res):





More information about the Commits mailing list