[Buildbot-commits] buildbot/buildbot master.py, 1.96, 1.97 scheduler.py, 1.19, 1.20

Brian Warner warner at users.sourceforge.net
Sun Sep 17 20:43:41 UTC 2006


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

Modified Files:
	master.py scheduler.py 
Log Message:
[project @ improve error messages when c['schedulers'] are broken]

Original author: warner at lothar.com
Date: 2006-09-17 20:32:53

Index: master.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- master.py	6 Sep 2006 00:41:54 -0000	1.96
+++ master.py	17 Sep 2006 20:43:39 -0000	1.97
@@ -733,9 +733,10 @@
             assert interfaces.IChangeSource(s, None)
         # this assertion catches c['schedulers'] = Scheduler(), since
         # Schedulers are service.MultiServices and thus iterable.
-        assert isinstance(schedulers, (list, tuple))
+        errmsg = "c['schedulers'] must be a list of Scheduler instances"
+        assert isinstance(schedulers, (list, tuple)), errmsg
         for s in schedulers:
-            assert interfaces.IScheduler(s, None)
+            assert interfaces.IScheduler(s, None), errmsg
         assert isinstance(status, (list, tuple))
         for s in status:
             assert interfaces.IStatusReceiver(s, None)
@@ -774,7 +775,7 @@
                 # Manhole, the ChangeMaster, and the BotMaster (although most
                 # of these don't have names)
                 msg = ("Schedulers must have unique names, but "
-                       "'%s' was a duplicate" + s.name)
+                       "'%s' was a duplicate" % (s.name,))
                 raise ValueError(msg)
             schedulernames.append(s.name)
 

Index: scheduler.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scheduler.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- scheduler.py	15 Sep 2006 14:50:23 -0000	1.19
+++ scheduler.py	17 Sep 2006 20:43:39 -0000	1.20
@@ -106,9 +106,12 @@
 
         BaseUpstreamScheduler.__init__(self, name)
         self.treeStableTimer = treeStableTimer
-        assert isinstance(builderNames, (list, tuple))
+        errmsg = ("The builderNames= argument to Scheduler must be a list "
+                  "of Builder description names (i.e. the 'name' key of the "
+                  "Builder specification dictionary)")
+        assert isinstance(builderNames, (list, tuple)), errmsg
         for b in builderNames:
-            assert isinstance(b, str)
+            assert isinstance(b, str), errmsg
         self.builderNames = builderNames
         self.branch = branch
         if fileIsImportant:





More information about the Commits mailing list