本文整理汇总了Python中WMCore.BossAir.RunJob.RunJob.update方法的典型用法代码示例。如果您正苦于以下问题:Python RunJob.update方法的具体用法?Python RunJob.update怎么用?Python RunJob.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMCore.BossAir.RunJob.RunJob
的用法示例。
在下文中一共展示了RunJob.update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadByWMBS
# 需要导入模块: from WMCore.BossAir.RunJob import RunJob [as 别名]
# 或者: from WMCore.BossAir.RunJob.RunJob import update [as 别名]
def loadByWMBS(self, wmbsJobs):
"""
_loadByWMBS_
Load BossAir info based on wmbs Jobs.
"""
if len(wmbsJobs) < 1:
return []
existingTransaction = self.beginTransaction()
jobList = self.loadByWMBSDAO.execute(jobs = wmbsJobs, conn = self.getDBConn(),
transaction = self.existingTransaction())
loadedJobs = []
for job in jobList:
rj = RunJob()
rj.update(job)
loadedJobs.append(rj)
self.commitTransaction(existingTransaction)
if not len(loadedJobs) == len(wmbsJobs):
logging.error("Mismatch in WMBS load: Some requested jobs not found!")
idList = [x['jobid'] for x in loadedJobs]
for job in wmbsJobs:
if not job['id'] in idList:
logging.error("Could not retrieve job with WMBS ID %i from BossAir database" % (job['id']))
return loadedJobs
示例2: _loadByStatus
# 需要导入模块: from WMCore.BossAir.RunJob import RunJob [as 别名]
# 或者: from WMCore.BossAir.RunJob.RunJob import update [as 别名]
def _loadByStatus(self, status, complete = '1'):
"""
_loadByStatus_
Load jobs by status
"""
if status not in self.states:
msg = "Asked to load by status %s which is not loaded\n" % (status)
msg += "This indicates that the wrong plugins are loaded\n"
logging.error(msg)
raise BossAirException(msg)
existingTransaction = self.beginTransaction()
loadJobs = self.loadJobsDAO.execute(status = status,
complete = complete,
conn = self.getDBConn(),
transaction = self.existingTransaction())
statusJobs = []
for jDict in loadJobs:
rj = RunJob()
rj.update(jDict)
statusJobs.append(rj)
self.commitTransaction(existingTransaction)
return statusJobs
示例3: _loadByID
# 需要导入模块: from WMCore.BossAir.RunJob import RunJob [as 别名]
# 或者: from WMCore.BossAir.RunJob.RunJob import update [as 别名]
def _loadByID(self, jobs):
"""
_loadByID_
Load by running Job ID
"""
loadJobsDAO = self.daoFactory(classname="LoadByID")
loadJobs = loadJobsDAO.execute(jobs=jobs, conn=self.getDBConn(),
transaction=self.existingTransaction())
loadedJobs = []
for jDict in loadJobs:
rj = RunJob()
rj.update(jDict)
loadedJobs.append(rj)
return loadedJobs
示例4: _listRunJobs
# 需要导入模块: from WMCore.BossAir.RunJob import RunJob [as 别名]
# 或者: from WMCore.BossAir.RunJob.RunJob import update [as 别名]
def _listRunJobs(self, active=True):
"""
_listRunJobs_
List runjobs, either active or complete
"""
if active:
runJobDicts = self.runningJobDAO.execute(conn=self.getDBConn(),
transaction=self.existingTransaction())
else:
runJobDicts = self.completeJobDAO.execute(conn=self.getDBConn(),
transaction=self.existingTransaction())
runJobs = []
for jDict in runJobDicts:
rj = RunJob()
rj.update(jDict)
runJobs.append(rj)
return runJobs