本文整理汇总了Python中buildbot.status.slave.SlaveStatus.getAccessURI方法的典型用法代码示例。如果您正苦于以下问题:Python SlaveStatus.getAccessURI方法的具体用法?Python SlaveStatus.getAccessURI怎么用?Python SlaveStatus.getAccessURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类buildbot.status.slave.SlaveStatus
的用法示例。
在下文中一共展示了SlaveStatus.getAccessURI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AbstractBuildSlave
# 需要导入模块: from buildbot.status.slave import SlaveStatus [as 别名]
# 或者: from buildbot.status.slave.SlaveStatus import getAccessURI [as 别名]
#.........这里部分代码省略.........
# all locks are available, claim them all
for lock, access in self.locks:
lock.claim(self, access)
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 _applySlaveInfo(self, info):
if not info:
return
self.slave_status.setAdmin(info.get("admin"))
self.slave_status.setHost(info.get("host"))
self.slave_status.setAccessURI(info.get("access_uri"))
self.slave_status.setVersion(info.get("version"))
def _saveSlaveInfoDict(self):
slaveinfo = {
'admin': self.slave_status.getAdmin(),
'host': self.slave_status.getHost(),
'access_uri': self.slave_status.getAccessURI(),
'version': self.slave_status.getVersion(),
}
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._applySlaveInfo(buildslave.get('slaveinfo'))
return d
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()
d = self._getSlaveInfo()
d.addCallback(lambda _: service.MultiService.startService(self))
return d