本文整理汇总了Python中dsadmin.DSAdmin.addSuffix方法的典型用法代码示例。如果您正苦于以下问题:Python DSAdmin.addSuffix方法的具体用法?Python DSAdmin.addSuffix怎么用?Python DSAdmin.addSuffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dsadmin.DSAdmin
的用法示例。
在下文中一共展示了DSAdmin.addSuffix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DSAdmin
# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import addSuffix [as 别名]
import os
import time
import ldap
from dsadmin import DSAdmin, Entry
host = "localhost.localdomain"
port = 10200
#os.environ['USE_DBX'] = "1"
#del os.environ['USE_DBX']
binddn = "cn=directory manager"
bindpw = "secret12"
conn = DSAdmin(host,port,binddn,bindpw)
suffix = "dc=example2,dc=com"
conn.addSuffix(suffix)
initfile = "/var/tmp/reftest.ldif"
conn.importLDIF(initfile, suffix, None, True)
示例2: DSAdmin
# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import addSuffix [as 别名]
host1 = "vmf8i386.testdomain.com"
host2 = "vmf9x8664.testdomain.com"
port1 = 389
port2 = 389
rootdn1 = "cn=directory manager"
rootpw1 = 'secret12'
rootdn2 = "cn=directory manager"
rootpw2 = 'secret12'
mux = DSAdmin(host1, port1, rootdn1, rootpw1)
farm = DSAdmin(host2, port2, rootdn2, rootpw2)
suffix = 'dc=chaintest'
# add the suffix
farm.addSuffix(suffix)
# add the suffix entry
dn = suffix
ent = Entry(dn)
ent.setValues('objectclass', 'domain')
farm.add_s(ent)
# setup chaining
mux.setupChaining(farm, suffix, False)
# add ctuser on farm
dn = 'uid=ctuser,' + suffix
ent = Entry(dn)
ent.setValues('objectclass', 'inetOrgPerson')
ent.setValues('cn', 'Chain Testuser')
ent.setValues('sn', 'Testuser')