[Buildbot-commits] buildbot/buildbot buildslave.py,1.9,1.10

Brian Warner warner at users.sourceforge.net
Tue Mar 18 21:41:17 UTC 2008


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

Modified Files:
	buildslave.py 
Log Message:
[project @ buildslave-repr-bulletproof.patch]
Make BuildSlave's __repr__ a bit more bulletproof; this allows, for example,
pretty-printing of configuration files before the twisted reactor starts.

Original author: dustin at v.igoro.us
Date: 2008-02-17 01:49:36+00:00

Index: buildslave.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/buildslave.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- buildslave.py	5 Feb 2008 21:05:34 -0000	1.9
+++ buildslave.py	18 Mar 2008 21:41:15 -0000	1.10
@@ -66,9 +66,12 @@
         self.max_builds = new.max_builds
 
     def __repr__(self):
-        builders = self.botmaster.getBuildersForSlave(self.slavename)
-        return "<BuildSlave '%s', current builders: %s>" % \
+        if self.botmaster:
+            builders = self.botmaster.getBuildersForSlave(self.slavename)
+            return "<BuildSlave '%s', current builders: %s>" % \
                (self.slavename, ','.join(map(lambda b: b.name, builders)))
+        else:
+            return "<BuildSlave '%s', (no builders yet)>" % self.slavename
 
     def setBotmaster(self, botmaster):
         assert not self.botmaster, "BuildSlave already has a botmaster"





More information about the Commits mailing list