Skip to content

Commit

Permalink
cleanup: remove dead code from the era of pickled BuildMasters
Browse files Browse the repository at this point in the history
(remove __setstate__, __getstate__, and styles.Versioned calls from
everything but Status and Change classes)
  • Loading branch information
warner committed Oct 6, 2009
1 parent bfe6015 commit 4c8e215
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 71 deletions.
28 changes: 2 additions & 26 deletions buildbot/master.py
Expand Up @@ -320,18 +320,12 @@ def perspective_pokeIRC(self):
def perspective_print(self, msg):
print "debug", msg

class Dispatcher(styles.Versioned):
class Dispatcher:
implements(portal.IRealm)
persistenceVersion = 2

def __init__(self):
self.names = {}

def upgradeToVersion1(self):
self.master = self.botmaster.parent
def upgradeToVersion2(self):
self.names = {}

def register(self, name, afactory):
self.names[name] = afactory
def unregister(self, name):
Expand Down Expand Up @@ -377,9 +371,8 @@ def _avatarAttached(self, p, mind):
# UNIXServer(ResourcePublisher(self.site))


class BuildMaster(service.MultiService, styles.Versioned):
class BuildMaster(service.MultiService):
debug = 0
persistenceVersion = 3
manhole = None
debugPassword = None
projectName = "(unspecified)"
Expand Down Expand Up @@ -426,23 +419,6 @@ def __init__(self, basedir, configFileName="master.cfg"):

self.readConfig = False

def upgradeToVersion1(self):
self.dispatcher = self.slaveFactory.root.portal.realm

def upgradeToVersion2(self): # post-0.4.3
self.webServer = self.webTCPPort
del self.webTCPPort
self.webDistribServer = self.webUNIXPort
del self.webUNIXPort
self.configFileName = "master.cfg"

def upgradeToVersion3(self):
# post 0.6.3, solely to deal with the 0.6.3 breakage. Starting with
# 0.6.5 I intend to do away with .tap files altogether
self.services = []
self.namedServices = {}
del self.change_svc

def startService(self):
service.MultiService.startService(self)
self.loadChanges() # must be done before loading the config file
Expand Down
7 changes: 0 additions & 7 deletions buildbot/pbutil.py
Expand Up @@ -72,13 +72,6 @@ def clientConnectionMade(self, broker):
self.doGetPerspective(self._root)
self.gotRootObject(self._root)

def __getstate__(self):
# this should get folded into ReconnectingClientFactory
d = self.__dict__.copy()
d['connector'] = None
d['_callID'] = None
return d

# oldcred methods

def getPerspective(self, *args):
Expand Down
6 changes: 0 additions & 6 deletions buildbot/process/base.py
Expand Up @@ -240,12 +240,6 @@ def allFiles(self):
def __repr__(self):
return "<Build %s>" % (self.builder.name,)

def __getstate__(self):
d = self.__dict__.copy()
if d.has_key('remote'):
del d['remote']
return d

def blamelist(self):
blamelist = []
for c in self.allChanges():
Expand Down
17 changes: 0 additions & 17 deletions buildbot/process/builder.py
Expand Up @@ -335,11 +335,6 @@ class Builder(pb.Referenceable):
I also manage forced builds, progress expectation (ETA) management, and
some status delivery chores.
I am persisted in C{BASEDIR/BUILDERNAME/builder}, so I can remember how
long a build usually takes to run (in my C{expectations} attribute). This
pickle also includes the L{buildbot.status.builder.BuilderStatus} object,
which remembers the set of historic builds.
@type buildable: list of L{buildbot.process.base.BuildRequest}
@ivar buildable: BuildRequests that are ready to build, but which are
waiting for a buildslave to be available.
Expand Down Expand Up @@ -462,18 +457,6 @@ def cancelBuildRequest(self, req):
return True
return False

def __getstate__(self):
d = self.__dict__.copy()
# TODO: note that d['buildable'] can contain Deferreds
del d['building'] # TODO: move these back to .buildable?
del d['slaves']
return d

def __setstate__(self, d):
self.__dict__ = d
self.building = []
self.slaves = []

def consumeTheSoulOfYourPredecessor(self, old):
"""Suck the brain out of an old Builder.
Expand Down
8 changes: 0 additions & 8 deletions buildbot/process/buildstep.py
Expand Up @@ -62,14 +62,6 @@ def __init__(self, remote_command, args):
self.remote_command = remote_command
self.args = args

def __getstate__(self):
dict = self.__dict__.copy()
# Remove the remote ref: if necessary (only for resumed builds), it
# will be reattached at resume time
if dict.has_key("remote"):
del dict["remote"]
return dict

def run(self, step, remote):
self.active = True
self.step = step
Expand Down
7 changes: 0 additions & 7 deletions buildbot/process/step_twisted2.py
Expand Up @@ -77,13 +77,6 @@ class RunUnitTestsJelly(RunUnitTests):
ResultTypes.SUCCESS: tests.SUCCESS,
}

def __getstate__(self):
#d = RunUnitTests.__getstate__(self)
d = self.__dict__.copy()
# Banana subclasses are Ephemeral
if d.has_key("decoder"):
del d['decoder']
return d
def start(self):
self.decoder = remote.DecodeReport(self)
# don't accept anything unpleasant from the (untrusted) build slave
Expand Down

0 comments on commit 4c8e215

Please sign in to comment.