本文整理汇总了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
示例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)