當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。