当前位置: 首页>>代码示例>>Python>>正文


Python SlaveStatus.getVersion方法代码示例

本文整理汇总了Python中buildbot.status.slave.SlaveStatus.getVersion方法的典型用法代码示例。如果您正苦于以下问题:Python SlaveStatus.getVersion方法的具体用法?Python SlaveStatus.getVersion怎么用?Python SlaveStatus.getVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在buildbot.status.slave.SlaveStatus的用法示例。


在下文中一共展示了SlaveStatus.getVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: AbstractBuildSlave

# 需要导入模块: from buildbot.status.slave import SlaveStatus [as 别名]
# 或者: from buildbot.status.slave.SlaveStatus import getVersion [as 别名]

#.........这里部分代码省略.........
        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

    @defer.inlineCallbacks
开发者ID:Macintosh4579,项目名称:buildbot,代码行数:70,代码来源:base.py


注:本文中的buildbot.status.slave.SlaveStatus.getVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。