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


Python RunJob.keys方法代码示例

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


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

示例1: _buildRunningJobs

# 需要导入模块: from WMCore.BossAir.RunJob import RunJob [as 别名]
# 或者: from WMCore.BossAir.RunJob.RunJob import keys [as 别名]
    def _buildRunningJobs(self, wmbsJobs):
        """
        _buildRunningJobs_

        Build running jobs by loading information from the database and
        compiling it into a runJob object.  This overwrites any information
        from the database with the info from the WMBS Job
        """

        finalJobs  = []
        loadedJobs = self.loadByWMBS(wmbsJobs = wmbsJobs)

        if len(wmbsJobs) != len(loadedJobs):
            logging.error("Could not load all jobs in BossAir for WMBS input")

        for wmbsJob in wmbsJobs:
            for runJob in loadedJobs:
                if runJob['jobid'] == wmbsJob['id'] and runJob['retry_count'] == wmbsJob['retry_count']:
                    rj = RunJob()
                    rj.buildFromJob(wmbsJob)
                    rj['id'] = runJob['id']
                    for key in rj.keys():
                        if rj[key] == None:
                            rj[key] = runJob.get(key, None)
                    finalJobs.append(rj)
                    break
            # If we get here, we're sort of screwed
            # It means that although we sent for it, we couldn't find it.
            # Possibly means that the job just isn't in there yet.
            # Make a note of it, then do nothing
            logging.debug("Could not successfully load a runJob for wmbsJob %i:%i\n" % (wmbsJob['id'], wmbsJob['retry_count']))
            logging.debug("WMBS Job: %s\n" % wmbsJob)


        return finalJobs
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:37,代码来源:BossAirAPI.py


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