[Buildbot-commits] buildbot/buildbot master.py,1.114,1.115

Brian Warner warner at users.sourceforge.net
Thu May 22 22:13:13 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17640/buildbot

Modified Files:
	master.py 
Log Message:
[project @ #124:global-properties.patch]
Support global properties, defined with c['properties'] = {} in master.cfg

Original author: dustin at v.igoro.us
Date: 2008-04-13 00:32:42+00:00

Index: master.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- master.py	22 May 2008 22:12:52 -0000	1.114
+++ master.py	22 May 2008 22:13:10 -0000	1.115
@@ -27,6 +27,7 @@
 from buildbot.sourcestamp import SourceStamp
 from buildbot.buildslave import BuildSlave
 from buildbot import interfaces
+from buildbot.process.properties import Properties
 
 ########################################
 
@@ -231,9 +232,6 @@
         assert isinstance(custom_props, dict), \
                "custom_props must be a dict (not %r)" % (custom_props,)
 
-        # Provide default values for any custom build properties the
-        # client did not send.
-
         c = interfaces.IControl(self.master)
         bc = c.getBuilder(buildername)
         ss = SourceStamp(branch, revision)
@@ -345,6 +343,7 @@
     projectURL = None
     buildbotURL = None
     change_svc = None
+    properties = Properties()
 
     def __init__(self, basedir, configFileName="master.cfg"):
         service.MultiService.__init__(self)
@@ -500,6 +499,7 @@
                       "schedulers", "builders",
                       "slavePortnum", "debugPassword", "manhole",
                       "status", "projectName", "projectURL", "buildbotURL",
+                      "properties"
                       )
         for k in config.keys():
             if k not in known_keys:
@@ -527,6 +527,7 @@
             projectName = config.get('projectName')
             projectURL = config.get('projectURL')
             buildbotURL = config.get('buildbotURL')
+            properties = config.get('properties', {})
 
         except KeyError, e:
             log.msg("config dictionary is missing a required parameter")
@@ -658,6 +659,9 @@
                     else:
                         locks[l.name] = l
 
+        if not isinstance(properties, dict):
+            raise ValueError("c['properties'] must be a dictionary")
+
         # slavePortnum supposed to be a strports specification
         if type(slavePortnum) is int:
             slavePortnum = "tcp:%d" % slavePortnum
@@ -672,6 +676,9 @@
         self.projectName = projectName
         self.projectURL = projectURL
         self.buildbotURL = buildbotURL
+        
+        self.properties = Properties()
+        self.properties.update(properties, self.configFileName)
 
         # self.slaves: Disconnect any that were attached and removed from the
         # list. Update self.checker with the new list of passwords, including





More information about the Commits mailing list