本文整理汇总了Python中buildbot.status.slave.SlaveStatus.updateInfo方法的典型用法代码示例。如果您正苦于以下问题:Python SlaveStatus.updateInfo方法的具体用法?Python SlaveStatus.updateInfo怎么用?Python SlaveStatus.updateInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类buildbot.status.slave.SlaveStatus
的用法示例。
在下文中一共展示了SlaveStatus.updateInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AbstractBuildSlave
# 需要导入模块: from buildbot.status.slave import SlaveStatus [as 别名]
# 或者: from buildbot.status.slave.SlaveStatus import updateInfo [as 别名]
#.........这里部分代码省略.........
return True
def releaseLocks(self):
"""
I am called to release any locks after a build has finished
"""
log.msg("releaseLocks(%s): %s" % (self, self.locks))
for lock, access in self.locks:
lock.release(self, access)
def _lockReleased(self):
"""One of the locks for this slave was released; try scheduling
builds."""
if not self.botmaster:
return # oh well..
self.botmaster.maybeStartBuildsForSlave(self.slavename)
def _saveSlaveInfoDict(self, slaveinfo):
return self.master.db.buildslaves.updateBuildslave(name=self.slavename, slaveinfo=slaveinfo)
def _getSlaveInfo(self):
d = self.master.db.buildslaves.getBuildslaveByName(self.slavename)
@d.addCallback
def applyInfo(buildslave):
if buildslave is None:
return
self.updateSlaveInfo(**buildslave["slaveinfo"])
return d
def updateSlaveInfo(self, **kwargs):
self.slave_status.updateInfo(**kwargs)
def getSlaveInfo(self, key, default=None):
return self.slave_status.getInfo(key, default)
def setServiceParent(self, parent):
# botmaster needs to set before setServiceParent which calls startService
self.botmaster = parent
self.master = parent.master
service.MultiService.setServiceParent(self, parent)
def startService(self):
self.updateLocks()
self.startMissingTimer()
self.slave_status.addInfoWatcher(self._saveSlaveInfoDict)
d = self._getSlaveInfo()
d.addCallback(lambda _: service.MultiService.startService(self))
return d
@defer.inlineCallbacks
def reconfigService(self, new_config):
# Given a new BuildSlave, configure this one identically. Because
# BuildSlave objects are remotely referenced, we can't replace them
# without disconnecting the slave, yet there's no reason to do that.
new = self.findNewSlaveInstance(new_config)
assert self.slavename == new.slavename
# do we need to re-register?
if (
not self.registration
or self.password != new.password
or new_config.protocols["pb"]["port"] != self.registered_port