本文整理匯總了Python中rucio.client.Client.add_rse方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.add_rse方法的具體用法?Python Client.add_rse怎麽用?Python Client.add_rse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rucio.client.Client
的用法示例。
在下文中一共展示了Client.add_rse方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: open
# 需要導入模塊: from rucio.client import Client [as 別名]
# 或者: from rucio.client.Client import add_rse [as 別名]
),
("events", "derived", "^\d+$", []),
]
if __name__ == "__main__":
# 1. Import the RSEs defined explicetly in the repository file
with open("etc/rse_repository.json") as json_data:
repo_data = json.load(json_data)
c = Client()
for rse in repo_data:
try:
deterministic = repo_data[rse].get("deterministic", True)
volatile = repo_data[rse].get("volatile", False)
c.add_rse(rse, deterministic=deterministic, volatile=volatile)
except Duplicate:
print "%(rse)s already added" % locals()
except:
errno, errstr = sys.exc_info()[:2]
trcbck = traceback.format_exc()
print "Interrupted processing with %s %s %s." % (errno, errstr, trcbck)
rses_total -= 1
for p_id in repo_data[rse]["protocols"]["supported"]:
try:
repo_data[rse]["protocols"]["supported"][p_id].update({"scheme": p_id})
c.add_protocol(rse, repo_data[rse]["protocols"]["supported"][p_id])
except Duplicate:
pass
except Exception:
errno, errstr = sys.exc_info()[:2]
示例2: Client
# 需要導入模塊: from rucio.client import Client [as 別名]
# 或者: from rucio.client.Client import add_rse [as 別名]
repo_data = json.load(json_data)
json_data.close()
c = Client()
for rse in repo_data:
try:
deterministic = repo_data[rse].get('deterministic', True)
volatile = repo_data[rse].get('volatile', False)
region_code = repo_data[rse].get('region_code')
country_name = repo_data[rse].get('country_name')
staging_area = repo_data[rse].get('staging_area')
continent = repo_data[rse].get('continent')
time_zone = repo_data[rse].get('time_zone')
ISP = repo_data[rse].get('ISP')
c.add_rse(rse, deterministic=deterministic, volatile=volatile,
region_code=region_code, country_name=country_name, staging_area=staging_area,
continent=continent, time_zone=time_zone, ISP=ISP)
except Duplicate:
print '%(rse)s already added' % locals()
except:
errno, errstr = sys.exc_info()[:2]
trcbck = traceback.format_exc()
print 'Interrupted processing with %s %s %s.' % (errno, errstr, trcbck)
for p_id in repo_data[rse]['protocols']['supported']:
try:
p = repo_data[rse]['protocols']['supported'][p_id]
p['scheme'] = p_id
c.add_protocol(rse, p)
except ValueError, e:
print rse, e
except Duplicate, e: