本文整理汇总了Python中DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient.getFileMetadata方法的典型用法代码示例。如果您正苦于以下问题:Python FileCatalogClient.getFileMetadata方法的具体用法?Python FileCatalogClient.getFileMetadata怎么用?Python FileCatalogClient.getFileMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient
的用法示例。
在下文中一共展示了FileCatalogClient.getFileMetadata方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __retrieveAllRemoteAttributes
# 需要导入模块: from DIRAC.Resources.Catalog.FileCatalogClient import FileCatalogClient [as 别名]
# 或者: from DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient import getFileMetadata [as 别名]
def __retrieveAllRemoteAttributes(self, lfnList):
fc = FileCatalogClient('DataManagement/FileCatalog')
result = fc.getFileMetadata(lfnList)
if not result['OK']:
raise Exception('getFileMetadata failed: %s' % result['Message'])
attributes = {}
for lfn in lfnList:
if lfn in result['Value']['Successful']:
attributes[lfn] = self.__parseMetadata(result['Value']['Successful'][lfn])
return attributes
示例2: compare
# 需要导入模块: from DIRAC.Resources.Catalog.FileCatalogClient import FileCatalogClient [as 别名]
# 或者: from DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient import getFileMetadata [as 别名]
def compare(attributes,input):
error_list = {}
inDFC = {}
#print "input keys:",input.keys()
keys = sorted(input.keys())
#print "keys after being sorted:",keys
expNum = _get_exp_num(attributes["expNum"])
eventType = _get_event_type(attributes["eventType"])
#dir = "/BES3/File/"+attributes["resonance"]+"/"+attributes["bossVer"]
dir = "/BES3/File/"+attributes["resonance"]+"/"+attributes["bossVer"]
if attributes["streamId"]=="stream0":
dir = dir+ "/data"+"/"+eventType + "/"+expNum+"/"+attributes["LFN"]
else:
dir = dir+"/mc"+"/"+eventType+"/"+expNum+"/"+attributes["streamId"]+"/"+attributes["LFN"]
client=FileCatalogClient()
result = client.getFileMetadata(dir)
file_exist = len(result['Value']['Successful'])
if file_exist == 0:
print "this file does't exist in DFC",attributes['LFN']
else:
result = client.getDirectoryMetadata(dir)
if result["OK"]:
inDFC["resonance"] = result["Value"]["resonance"]
inDFC["streamId"] = result["Value"]["streamId"]
inDFC["eventType"] = result["Value"]["eventType"]
inDFC["bossVer"] = result["Value"]["bossVer"]
inDFC["expNum"] = result["Value"]["expNum"]
for key in keys:
if input[key] != inDFC[key]:
error_list[key] = inDFC[key]
if error_list is not None:
return error_list