本文整理汇总了Python中pandatools.Client.convertDQ2toPandaID方法的典型用法代码示例。如果您正苦于以下问题:Python Client.convertDQ2toPandaID方法的具体用法?Python Client.convertDQ2toPandaID怎么用?Python Client.convertDQ2toPandaID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandatools.Client
的用法示例。
在下文中一共展示了Client.convertDQ2toPandaID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: expandExcludedSiteList
# 需要导入模块: from pandatools import Client [as 别名]
# 或者: from pandatools.Client import convertDQ2toPandaID [as 别名]
def expandExcludedSiteList( job ):
'''Expand a site list taking wildcards into account'''
# first, check if there's anything to be done
check_ddm = False
wildcard = False
excl_sites = []
for s in job.backend.requirements.excluded_sites:
if s.find("ANALY_") == -1:
check_ddm = True
if s.find("*") != -1:
wildcard = True
if s.find("ANALY_") != -1 and s.find("*") == -1:
excl_sites.append(s)
if not check_ddm and not wildcard:
return excl_sites
# we have either wildcards or DDM sites listed
# First, find the allowed sites for this job and ensure no duplicates anywhere
from pandatools import Client
logger.info("Excluding DDM and wildcarded sites from Jedi job. Please wait....")
orig_ddm_list = []
new_ddm_list = []
for s in job.inputdata.get_locations():
if not s in orig_ddm_list:
orig_ddm_list.append(s)
new_ddm_list.append(s)
orig_panda_list = []
for s in [Client.convertDQ2toPandaID(x) for x in new_ddm_list]:
for s2 in Client.PandaSites.keys():
if s2.find(s) != -1 and not s2 in orig_panda_list:
orig_panda_list.append(s2)
if check_ddm:
# remove any DDM sites that are referenced, including wildcards
for s in job.backend.requirements.excluded_sites:
if s in orig_ddm_list:
new_ddm_list.remove(s)
if s.find("*") != -1:
for s2 in orig_ddm_list:
if fnmatch.fnmatch(s2, s):
new_ddm_list.remove(s2)
# now recreate the panda list and see if any have been dropped
new_panda_list = []
for s in [Client.convertDQ2toPandaID(x) for x in new_ddm_list]:
for s2 in Client.PandaSites.keys():
if s2.find(s) != -1 and not s2 in new_panda_list:
new_panda_list.append(s)
for s in orig_panda_list:
if not s in new_panda_list and not s in excl_sites:
excl_sites.append(s)
if wildcard:
# find wilcarded ANALY_* sites and exclude any that match good sites
for s in job.backend.requirements.excluded_sites:
if s.find("*") != -1:
for s2 in orig_panda_list:
if fnmatch.fnmatch(s2, s) and not s2 in excl_sites:
excl_sites.append(s2)
return excl_sites