[Buildbot-commits] buildbot/buildbot master.py,1.106,1.107
Brian Warner
warner at users.sourceforge.net
Wed Aug 1 20:31:28 UTC 2007
Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23570/buildbot
Modified Files:
master.py
Log Message:
[project @ replace c['sources'] with c['change_source']]
Original author: warner at lothar.com
Date: 2007-07-28 20:03:12+00:00
Index: master.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- master.py 27 Jul 2007 10:13:55 -0000 1.106
+++ master.py 1 Aug 2007 20:31:26 -0000 1.107
@@ -651,7 +651,9 @@
log.err("config file must define BuildmasterConfig")
raise
- known_keys = ("bots", "slaves", "sources", "schedulers", "builders",
+ known_keys = ("bots", "slaves",
+ "sources", "change_source",
+ "schedulers", "builders",
"slavePortnum", "debugPassword", "manhole",
"status", "projectName", "projectURL", "buildbotURL",
)
@@ -661,11 +663,11 @@
try:
# required
- sources = config['sources']
schedulers = config['schedulers']
builders = config['builders']
slavePortnum = config['slavePortnum']
#slaves = config['slaves']
+ #change_source = config['change_source']
# optional
debugPassword = config.get('debugPassword')
@@ -685,8 +687,8 @@
slaves = config.get('slaves', [])
if "bots" in config:
- m = ("c['bots'] is deprecated as of 0.7.6, please use "
- "c['slaves'] instead")
+ m = ("c['bots'] is deprecated as of 0.7.6 and will be "
+ "removed by 0.8.0 . Please use c['slaves'] instead.")
log.msg(m)
warnings.warn(m, DeprecationWarning)
for name, passwd in config['bots']:
@@ -697,6 +699,22 @@
log.msg("leaving old configuration in place")
raise KeyError("must have either 'bots' or 'slaves'")
+ #if "sources" in config:
+ # raise KeyError("c['sources'] is no longer accepted")
+
+ change_source = config.get('change_source', [])
+ if isinstance(change_source, (list, tuple)):
+ change_sources = change_source
+ else:
+ change_sources = [change_source]
+ if "sources" in config:
+ m = ("c['sources'] is deprecated as of 0.7.6 and will be "
+ "removed by 0.8.0 . Please use c['change_source'] instead.")
+ log.msg(m)
+ warnings.warn(m, DeprecationWarning)
+ for s in config['sources']:
+ change_sources.append(s)
+
# do some validation first
for s in slaves:
assert isinstance(s, BuildSlave)
@@ -705,8 +723,8 @@
if config.has_key('interlocks'):
raise KeyError("c['interlocks'] is no longer accepted")
- assert isinstance(sources, (list, tuple))
- for s in sources:
+ assert isinstance(change_sources, (list, tuple))
+ for s in change_sources:
assert interfaces.IChangeSource(s, None)
# this assertion catches c['schedulers'] = Scheduler(), since
# Schedulers are service.MultiServices and thus iterable.
@@ -839,7 +857,7 @@
# Schedulers are added after Builders in case they start right away
d.addCallback(lambda res: self.loadConfig_Schedulers(schedulers))
# and Sources go after Schedulers for the same reason
- d.addCallback(lambda res: self.loadConfig_Sources(sources))
+ d.addCallback(lambda res: self.loadConfig_Sources(change_sources))
# self.slavePort
if self.slavePortnum != slavePortnum:
@@ -892,8 +910,8 @@
return d
def loadConfig_Sources(self, sources):
- log.msg("loadConfig_Sources, change_svc is", self.change_svc,
- self.change_svc.parent)
+ if not sources:
+ log.msg("warning: no ChangeSources specified in c['change_source']")
# shut down any that were removed, start any that were added
deleted_sources = [s for s in self.change_svc if s not in sources]
added_sources = [s for s in sources if s not in self.change_svc]
More information about the Commits
mailing list