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


Python Client.checkMergeGenerationStatus方法代码示例

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


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

示例1: setMergeJobStatus

# 需要导入模块: from pandatools import Client [as 别名]
# 或者: from pandatools.Client import checkMergeGenerationStatus [as 别名]
 def setMergeJobStatus(self,job,forceUpdate=False):
     # only whenmerge job generation is active
     if not forceUpdate and not job.activeMergeGen():
         return True
     # get logger
     tmpLog = PLogger.getPandaLogger()
     # check status of merge job generation
     status,genStauts = Client.checkMergeGenerationStatus(job.JobID,verbose=self.verbose)
     if status != 0:
         tmpLog.error(genStauts)
         tmpLog.error("Failed to check status of merge job generation for JobID=%s" % job.JobID)
         return False
     # set status
     job.mergeJobStatus = genStauts['status']
     # set merge job IDs
     if genStauts['mergeIDs'] != []:
         job.mergeJobID = ''
         for tmpID in genStauts['mergeIDs']:
             job.mergeJobID += '%s,' % tmpID
         job.mergeJobID = job.mergeJobID[:-1]
     # return
     return True
开发者ID:PanDAWMS,项目名称:panda-client,代码行数:24,代码来源:PBookCore.py

示例2: retrieveMergeJobs

# 需要导入模块: from pandatools import Client [as 别名]
# 或者: from pandatools.Client import checkMergeGenerationStatus [as 别名]
def retrieveMergeJobs(job, pandaJobDefId):
    '''
    methods for retrieving panda job ids of merging jobs given a jobDefId
    '''
    from pandatools import Client

    ick       = False
    status    = ''
    num_mjobs = 0

    (ec, info) = Client.checkMergeGenerationStatus(pandaJobDefId)

    if ec == 0:

        try:
            status         = info['status']
            mergeJobDefIds = info['mergeIDs']

            if status == 'NA':
                logger.warning('No merging jobs expected')
                job.backend.mergejobs = []

            elif status == 'generating':
                logger.debug('merging jobs are generating')
                job.backend.mergejobs = []

            elif status == 'standby':
                logger.debug('merging jobs to be created')
                job.backend.mergejobs = []

            elif status == 'generated':
                logger.debug('merging jobs are generated')

                for id in mergeJobDefIds:
                    logger.debug("merging jobDefId: %d" % id)

                    ## retrieve merging job id,status given the jobDefId
                    (ec2, mjs) = Client.getPandIDsWithJobID(id)

                    if ec2 == 0:

                        for jid,jinfo in mjs.items():
                            mjobj = PandaMergeJob()
                            mjobj.id     = jid
                            #mjobj.status = jinfo[0]
                            mjobj.url    = 'http://panda.cern.ch/?job=%d' % jid

                            if mjobj not in job.backend.mergejobs:
                                job.backend.mergejobs.append(mjobj)
                            else:
                                logger.debug("merging job %s already exists locally" % mjobj.id)

                            num_mjobs += 1
                    else:
                        logger.warning("getPandIDsWithJobID returns non-zero exit code: %d" % ec2)

            ick = True

        except KeyError:
            logger.error('unexpected job information: %s' % repr(info))

        except Exception as e:
            logger.error('general merge job information retrieval error')
            raise e

    else:
        logger.error('checkMergeGenerationStatus returns non-zero exit code: %d' % ec)

    return (ick, status, num_mjobs)
开发者ID:MannyMoo,项目名称:ganga,代码行数:71,代码来源:Jedi.py


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