[Buildbot-commits] buildbot/buildbot/process builder.py,1.48,1.49
Brian Warner
warner at users.sourceforge.net
Tue Aug 7 19:48:56 UTC 2007
Update of /cvsroot/buildbot/buildbot/buildbot/process
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28164/buildbot/process
Modified Files:
builder.py
Log Message:
[project @ add BuildSlave.canStartBuild, use it to decide if slaves can be used]
Original author: warner at lothar.com
Date: 2007-08-07 19:48:24+00:00
Index: builder.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/builder.py,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- builder.py 7 Aug 2007 19:21:40 -0000 1.48
+++ builder.py 7 Aug 2007 19:48:54 -0000 1.49
@@ -49,11 +49,27 @@
return self.remoteCommands.get(command)
def isAvailable(self):
- if self.state == IDLE:
- return True
+ # if this SlaveBuilder is busy, then it's definitely not available
+ if self.state != IDLE:
+ return False
+
+ # otherwise, check in with the BuildSlave
+ if self.slave:
+ return self.slave.canStartBuild()
+
+ # no slave? not very available.
return False
def attached(self, slave, remote, commands):
+ """
+ @type slave: L{buildbot.buildslave.BuildSlave}
+ @param slave: the BuildSlave that represents the buildslave as a
+ whole
+ @type remote: L{twisted.spread.pb.RemoteReference}
+ @param remote: a reference to the L{buildbot.slave.bot.SlaveBuilder}
+ @type commands: dict: string -> string, or None
+ @param commands: provides the slave's version of each RemoteCommand
+ """
self.slave = slave
self.remote = remote
self.remoteCommands = commands # maps command name to version
More information about the Commits
mailing list