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


Python DSAdmin.added_replicas方法代码示例

本文整理汇总了Python中dsadmin.DSAdmin.added_replicas方法的典型用法代码示例。如果您正苦于以下问题:Python DSAdmin.added_replicas方法的具体用法?Python DSAdmin.added_replicas怎么用?Python DSAdmin.added_replicas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dsadmin.DSAdmin的用法示例。


在下文中一共展示了DSAdmin.added_replicas方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import added_replicas [as 别名]
def setup():
    global conn
    conn = DSAdmin(**config.auth)
    conn.verbose = True
    conn.added_entries = []
    conn.added_backends = set(['o=mockbe2'])
    conn.added_replicas = []
    harn_nolog()
开发者ID:danielino,项目名称:dsadmin,代码行数:10,代码来源:dsadmin_test.py

示例2: setup

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import added_replicas [as 别名]
def setup():
    # uses an existing 389 instance
    # add a suffix
    # add an agreement
    # This setup is quite verbose but to test dsadmin method we should
    # do things manually. A better solution would be to use an LDIF.
    global conn
    conn = DSAdmin(**config.auth)
    conn.verbose = True
    conn.added_entries = []
    conn.added_backends = set(['o=mockbe1'])
    conn.added_replicas = []
    """  
开发者ID:danielino,项目名称:dsadmin,代码行数:15,代码来源:config_test.py

示例3: setup

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import added_replicas [as 别名]
def setup():
    # uses an existing 389 instance
    # add a suffix
    # add an agreement
    # This setup is quite verbose but to test dsadmin method we should
    # do things manually. A better solution would be to use an LDIF.
    global conn
    conn = DSAdmin(**config.auth)
    conn.verbose = True
    conn.added_entries = []
    conn.added_backends = set(["o=mockbe1"])
    conn.added_replicas = []

    # add a backend for testing ruv and agreements
    addbackend_harn(conn, "testReplica")

    # add another backend for testing replica.add()
    addbackend_harn(conn, "testReplicaCreation")
开发者ID:pudquick,项目名称:dsadmin,代码行数:20,代码来源:backend_test.py

示例4: setup

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import added_replicas [as 别名]
def setup():
    # uses an existing 389 instance
    # add a suffix
    # add an agreement
    # This setup is quite verbose but to test dsadmin method we should
    # do things manually. A better solution would be to use an LDIF.
    global conn
    conn = DSAdmin(**config.auth)
    conn.verbose = True
    conn.added_entries = []
    conn.added_backends = set(['o=mockbe1'])
    conn.added_replicas = []

    # add a backend for testing ruv and agreements
    addbackend_harn(conn, 'testReplica')

    # add another backend for testing replica.add()
    addbackend_harn(conn, 'testReplicaCreation')

    # replication needs changelog
    conn.replica.changelog()
    # add rmanager entry
    try:
        conn.add_s(Entry((DN_RMANAGER, {
            'objectclass': "top person inetOrgPerson".split(),
            'sn': ["bind dn pseudo user"],
            'cn': 'replication manager',
            'uid': 'rmanager'
        }))
        )
        conn.added_entries.append(DN_RMANAGER)
    except ldap.ALREADY_EXISTS:
        pass

    # add a master replica entry
    # to test ruv and agreements
    replica_dn = ','.join(
        ['cn=replica', 'cn="o=testReplica"', DN_MAPPING_TREE])
    replica_e = Entry(replica_dn)
    replica_e.update({
                     'objectclass': ["top", "nsds5replica", "extensibleobject"],
                     'cn': "replica",
                     'nsds5replicaroot': 'o=testReplica',
                     'nsds5replicaid': MOCK_REPLICA_ID,
                     'nsds5replicatype': '3',
                     'nsds5flags': '1',
                     'nsds5replicabinddn': DN_RMANAGER
                     })
    try:
        conn.add_s(replica_e)
    except ldap.ALREADY_EXISTS:
        pass
    conn.added_entries.append(replica_dn)

    agreement_dn = ','.join(('cn=testAgreement', replica_dn))
    agreement_e = Entry(agreement_dn)
    agreement_e.update({
                       'objectclass': ["top", "nsds5replicationagreement"],
                       'cn': 'testAgreement',
                       'nsds5replicahost': 'localhost',
                       'nsds5replicaport': '22389',
                       'nsds5replicatimeout': '120',
                       'nsds5replicabinddn': DN_RMANAGER,
                       'nsds5replicacredentials': 'password',
                       'nsds5replicabindmethod': 'simple',
                       'nsds5replicaroot': 'o=testReplica',
                       'nsds5replicaupdateschedule': '0000-2359 0123456',
                       'description': 'testAgreement'
                       })
    try:
        conn.add_s(agreement_e)
    except ldap.ALREADY_EXISTS:
        pass
    conn.added_entries.append(agreement_dn)
    conn.agreement_dn = agreement_dn
开发者ID:danielino,项目名称:dsadmin,代码行数:77,代码来源:replica_test.py


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