当前位置: 首页>>代码示例>>Python>>正文


Python Client.add_rse方法代码示例

本文整理汇总了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]
开发者ID:pombredanne,项目名称:rucio,代码行数:33,代码来源:bootstrap_stresstest.py

示例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:
开发者ID:pombredanne,项目名称:rucio,代码行数:33,代码来源:sync_rses.py


注:本文中的rucio.client.Client.add_rse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。