[Buildbot-commits] buildbot/buildbot master.py,1.74,1.75

Brian Warner warner at users.sourceforge.net
Tue Jul 19 23:23:23 UTC 2005


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

Modified Files:
	master.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-242
Creator:  Brian Warner <warner at monolith.lothar.com>

remove references to old 'interlock' module

	* buildbot/master.py (BuildMaster): remove references to old
	'interlock' module, this caused a bunch of post-merge test
	failures
	* buildbot/test/test_config.py: same
	* buildbot/process/base.py (Build): same


Index: master.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- master.py	19 Jul 2005 23:11:59 -0000	1.74
+++ master.py	19 Jul 2005 23:23:21 -0000	1.75
@@ -24,7 +24,6 @@
 from buildbot.twcompat import implements
 from buildbot.util import now
 from buildbot.pbutil import NewCredPerspective
-from buildbot.process.interlock import Interlock
 from buildbot.process.builder import Builder
 from buildbot.status.builder import BuilderStatus, SlaveStatus, Status
 from buildbot.changes.changes import Change, ChangeMaster
@@ -291,7 +290,6 @@
         # They are added by calling botmaster.addBuilder() from the startup
         # code.
         self.slaves = {} # maps slavename to BotPerspective
-        self.interlocks = {}
         self.statusClientService = None
         self.watchers = {}
 
@@ -359,7 +357,6 @@
         self.builders[builder.name] = builder
         self.builderNames.append(builder.name)
         builder.setBotmaster(self)
-        #self.checkInactiveInterlocks() # TODO?: do this in caller instead?
 
         slave = self.slaves[slavename]
         return slave.addBuilder(builder)
@@ -374,18 +371,6 @@
         if self.debug: print "removeBuilder", builder
         log.msg("Botmaster.removeBuilder(%s)" % builder.name)
         b = self.builders[builder.name]
-        # any linked interlocks will be made inactive before the builder is
-        # removed
-##         interlocks = []
-##         for i in b.feeders:
-##             assert i not in interlocks
-##             interlocks.append(i)
-##         for i in b.interlocks:
-##             assert i not in interlocks
-##             interlocks.append(i)
-##         for i in interlocks:
-##             if self.debug: print " deactivating interlock", i
-##             i.deactivate(self.builders)
         del self.builders[builder.name]
         self.builderNames.remove(builder.name)
         slave = self.slaves.get(builder.slavename)
@@ -393,38 +378,6 @@
             return slave.removeBuilder(builder)
         return defer.succeed(None)
 
-    def addInterlock(self, interlock):
-        """This is called by the setup code to create build interlocks:
-        objects which let one build wait until another has successfully
-        build the same set of changes. These objects are created by name,
-        then builds are told if they feed the interlock or if the interlock
-        feeds them.
-
-        If any of the referenced builds do not exist, the interlock is left
-        inactive. All inactive interlocks will be checked again when new
-        builders are added. This should only be a transient condition as
-        config changes are read: if it persists after the config file is
-        fully parsed, a warning should be emitted.
-        """
-
-        if self.debug: print "addInterlock", interlock
-        assert isinstance(interlock, Interlock)
-        self.interlocks[interlock.name] = interlock
-        interlock.tryToActivate(self.builders)
-
-    def checkInactiveInterlocks(self):
-        if self.debug: print "checkInactiveInterlocks"
-        for interlock in self.interlocks.values():
-            if not interlock.active:
-                interlock.tryToActivate(self.builders)
-
-    def removeInterlock(self, interlock):
-        if self.debug: print "removeInterlock", interlock
-        assert isinstance(interlock, Interlock)
-        del self.interlocks[interlock.name]
-        if interlock.active:
-            interlock.deactivate(self.builders)
-
     def getPerspective(self, slavename):
         return self.slaves[slavename]
 
@@ -759,18 +712,6 @@
         if config.has_key('interlocks'):
             raise KeyError("c['interlocks'] is no longer accepted")
 
-##         for i in interlocks:
-##             name, feeders, watchers = i
-##             if type(feeders) != type([]):
-##                 raise TypeError, "interlock feeders must be a list"
-##             if type(watchers) != type([]):
-##                 raise TypeError, "interlock watchers must be a list"
-##             bnames = feeders + watchers
-##             for bname in bnames:
-##                 if bnames.count(bname) > 1:
-##                     why = ("builder '%s' appears multiple times for " + \
-##                            "interlock %s") % (bname, name)
-##                     raise ValueError, why
         for s in status:
             assert interfaces.IStatusReceiver(s)
 
@@ -872,9 +813,6 @@
                 self.slavePort.setServiceParent(self)
                 log.msg("BuildMaster listening on port %d" % slavePortnum)
             self.slavePortnum = slavePortnum
-
-        # self.interlocks:
-        #self.loadConfig_Interlocks(interlocks)
         
         log.msg("configuration updated")
         self.readConfig = True
@@ -999,39 +937,6 @@
 
         return defer.DeferredList(dl)
 
-    def loadConfig_Interlocks(self, newInterlocks):
-        newList = {}
-        for interlockData in newInterlocks:
-            name, feeders, watchers = interlockData
-            feeders.sort()
-            watchers.sort()
-            newList[name] = interlockData
-        # identify all that were removed, and remove them
-        for old in self.botmaster.interlocks.values():
-            if old.name not in newList.keys():
-                if self.debug: print "old interlock", old
-                self.botmaster.removeInterlock(old)
-        # everything in newList is either unchanged, changed, or new
-        for newName, data in newList.items():
-            old = self.botmaster.interlocks.get(newName)
-            name, feeders, watchers = data
-            if not old:
-                # new
-                i = Interlock(name, feeders, watchers)
-                if self.debug: print "new interlock", i
-                self.botmaster.addInterlock(i)
-            elif (old.feederNames == feeders and
-                  old.watcherNames == watchers):
-                # unchanged: leave it alone
-                if self.debug: print "unchanged interlock", old
-                pass
-            else:
-                # changed: remove and re-add
-                if self.debug: print "interlock changed", name
-                self.botmaster.removeInterlock(old)
-                i = Interlock(name, feeders, watchers)
-                self.botmaster.addInterlock(i)
-
 
     def addChange(self, change):
         for s in self.schedulers:





More information about the Commits mailing list