[cig-commits] r7063 - cs/buildbot/trunk/buildbot

leif at geodynamics.org leif at geodynamics.org
Mon Jun 4 16:50:43 PDT 2007


Author: leif
Date: 2007-06-04 16:50:43 -0700 (Mon, 04 Jun 2007)
New Revision: 7063

Modified:
   cs/buildbot/trunk/buildbot/config.py
Log:
Re-implemented the ability to assign multiple slaves to a single
column.  (There isn't a license for PGI on CITerra, so this the only
way I can make both head nodes be useful.)


Modified: cs/buildbot/trunk/buildbot/config.py
===================================================================
--- cs/buildbot/trunk/buildbot/config.py	2007-06-04 23:12:56 UTC (rev 7062)
+++ cs/buildbot/trunk/buildbot/config.py	2007-06-04 23:50:43 UTC (rev 7063)
@@ -1,7 +1,7 @@
 
 
 class BuildConfig(object):
-    def __init__(self, name, env, slave=None, configureArgs=None):
+    def __init__(self, name, env, slaves=None, configureArgs=None):
         self.name = name
         self.env = env
 
@@ -13,7 +13,7 @@
         # BuildConfig is assigned to a unique slave.  If 'slave' is
         # 'None', it uses 'defaultSlave' from the parent
         # BuildEnvironment.
-        self.slave = slave
+        self.slaves = slaves
         
         self.configureArgs = configureArgs or {}
 
@@ -34,9 +34,9 @@
 # (identical) BuildSlaves.
 
 class BuildEnvironment(object):
-    def __init__(self, name, defaultSlave=None, configs=defaultConfigs):
+    def __init__(self, name, defaultSlaves=None, configs=defaultConfigs):
         self.name = name
-        self.defaultSlave = defaultSlave
+        self.defaultSlaves = defaultSlaves
         self.configs = configs
         return
 
@@ -105,13 +105,15 @@
     def collectBots(self):
         slaves = []
         for env in self.buildEnvironments:
-            slave = env.defaultSlave                
-            if slave and not slave in slaves:
-                slaves.append(slave)
+            if env.defaultSlaves:
+                for slave in env.defaultSlaves:
+                    if not slave in slaves:
+                        slaves.append(slave)
             for config in env.configs:
-                slave = config.slave
-                if slave and not slave in slaves:
-                    slaves.append(slave)
+                if config.slaves:
+                    for slave in config.slaves:
+                        if not slave in slaves:
+                            slaves.append(slave)
         self.bots = [(slave.name, slave.password) for slave in slaves]
         return
 
@@ -135,10 +137,10 @@
 
                 for buildConfig in buildEnv.configs:
 
-                    slave = buildConfig.slave or buildEnv.defaultSlave
+                    slaves = buildConfig.slaves or buildEnv.defaultSlaves
 
                     builder = line.newBuilder(buildEnv, buildConfig)
-                    builder['slavenames'] = [slave.name]
+                    builder['slavenames'] = [slave.name for slave in slaves]
 
                     import os
                     from os.path import isdir, expanduser



More information about the cig-commits mailing list