本文整理汇总了Python中pandatools.Client.addDatasetsToContainer方法的典型用法代码示例。如果您正苦于以下问题:Python Client.addDatasetsToContainer方法的具体用法?Python Client.addDatasetsToContainer怎么用?Python Client.addDatasetsToContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandatools.Client
的用法示例。
在下文中一共展示了Client.addDatasetsToContainer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addDatasetsToContainer
# 需要导入模块: from pandatools import Client [as 别名]
# 或者: from pandatools.Client import addDatasetsToContainer [as 别名]
def addDatasetsToContainer(container, datasets):
from pandatools import Client
# HC datasets don't use containers
if not configPanda["processingType"].startswith("gangarobot") and not configPanda["processingType"].startswith(
"hammercloud"
):
Client.addDatasetsToContainer(container, datasets, False)
示例2: retry
# 需要导入模块: from pandatools import Client [as 别名]
# 或者: from pandatools.Client import addDatasetsToContainer [as 别名]
#.........这里部分代码省略.........
newOpts['provenanceID'] = retryJobs[0].jobExecutionID
newOpts['panda_parentJobsetID'] = retryJobs[0].sourceSite
tmpLog.info("Constructing job spec again to be sent to another site ...")
comStat= PsubUtils.execWithModifiedParams(retryJobs,newOpts,self.verbose,newSite)
if comStat == 0:
# update database
time.sleep(2)
self.sync()
else:
tmpLog.error("Failed to submit jobs to Panda server")
return
# register datasets
tmpOutDsLocation = Client.PandaSites[retryJobs[-1].computingSite]['ddm']
addedDataset = []
shadowDSname = None
for tmpFile in retryJobs[-1].Files:
if tmpFile.type in ['output','log'] and tmpFile.dataset.endswith('/'):
# add shadow
"""
removed shadow
if shadowDSname == None and tmpFile.type == 'log':
shadowDSname = "%s%s" % (tmpFile.destinationDBlock,Client.suffixShadow)
Client.addDataset(shadowDSname,self.verbose)
"""
# add datasets
if not tmpFile.destinationDBlock in addedDataset:
# create dataset
Client.addDataset(
tmpFile.destinationDBlock,
self.verbose,
location=tmpOutDsLocation,
dsCheck=False)
# add to container
Client.addDatasetsToContainer(
tmpFile.dataset,
[tmpFile.destinationDBlock],
self.verbose)
# append
addedDataset.append(tmpFile.destinationDBlock)
# register libDS
if retryBuild and newLibDS != None:
Client.addDataset(
newLibDS,
self.verbose,
location=tmpOutDsLocation,
dsCheck=False)
# submit
tmpLog.info("Submitting job ...")
status,out = Client.submitJobs(retryJobs,verbose=self.verbose)
if out == None or status != 0:
tmpLog.error(status)
tmpLog.error(out)
tmpLog.error("Failed to submit jobs to Panda server")
return
# update database
pandaIDstatus = {}
newJobID = None
for items in out:
# get newJobID
if newJobID == None:
newJobID = items[1]
# check PandaID
PandaID = items[0]
if PandaID == 'NULL':
tmpLog.error("Panda server returned wrong IDs. It may have a temporary problem")
return