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


Python DSAdmin.createAndSetupReplica方法代码示例

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


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

示例1:

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import createAndSetupReplica [as 别名]
basedn = 'dc=example,dc=com'
replargs = {}
srvs = []
m1replargs = {
	'suffix': basedn,
	'bename': "userRoot",
	'binddn': "cn=replrepl,cn=config",
	'bindcn': "replrepl",
	'bindpw': "replrepl"
}
os.environ['USE_GDB'] = "1"
m1 = DSAdmin.createAndSetupReplica({
	'newrootpw': 'password',
	'newhost': host1,
	'newport': port1,
	'newinst': 'm1',
	'newsuffix': basedn,
    'no_admin': True
}, m1replargs
)
del os.environ['USE_GDB']
replargs[m1] = m1replargs
srvs.append(m1)

m2replargs = m1replargs
m2 = DSAdmin.createAndSetupReplica({
	'newrootpw': 'password',
	'newhost': host2,
	'newport': port2,
	'newinst': 'm2',
	'newsuffix': basedn,
开发者ID:CACloudAdmin,项目名称:scripts,代码行数:33,代码来源:bug507744.py

示例2:

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import createAndSetupReplica [as 别名]
    'newinst': 'm1',
    'newsuffix': basedn,
    'no_admin': True
}

m1replargs = {
	'suffix': basedn,
	'bename': "userRoot",
	'binddn': "cn=replrepl,cn=config",
	'bindcn': "replrepl",
	'bindpw': "replrepl"
}

#os.environ['USE_DBX'] = "1"
#os.environ['USE_CALLGRIND'] = "1"
m1 = DSAdmin.createAndSetupReplica(createargs, m1replargs)
#del os.environ['USE_CALLGRIND']
#del os.environ['USE_DBX']

if 'USE_DRD' in os.environ:
    del os.environ['USE_DRD']
if 'USE_CALLGRIND' in os.environ:
    del os.environ['USE_CALLGRIND']

m2replargs = m1replargs
createargs['newhost'] = host2
createargs['newport'] = port2
createargs['newinst'] = 'm2'
#os.environ['USE_GDB'] = "1"
m2 = DSAdmin.createAndSetupReplica(createargs, m2replargs)
#del os.environ['USE_GDB']
开发者ID:CACloudAdmin,项目名称:scripts,代码行数:33,代码来源:ticket-294.py

示例3: dict

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import createAndSetupReplica [as 别名]
	'newport': port1,
	'newinst': 'm1',
	'newsuffix': basedn,
	'no_admin': True
}
m1replargs = {
	'suffix': basedn,
	'bename': "userRoot",
	'binddn': "cn=replrepl,cn=config",
	'bindcn': "replrepl",
	'bindpw': "replrepl",
        'starttls': True,
        'chain' : True
}

m1 = DSAdmin.createAndSetupReplica(m1createargs, m1replargs)
#del os.environ['USE_DBX']

#os.environ['USE_DBX'] = 1
# copy c1 args from m1
c1createargs = dict([(key,val) for key,val in m1createargs.iteritems()])
c1['newhost'] = host2
c1['newport'] = port2
c1['newinst'] = 'c1'
c1replargs = dict([(key,val) for key,val in m1replargs.iteritems()])
c1replargs['type'] = LEAF_TYPE
clreplargs['chainargs'] = {'nsUseStartTLS': 'TRUE'}

#os.environ['USE_DBX'] = "1"
c1 = DSAdmin.createAndSetupReplica(c1createargs, c1replargs)
#del os.environ['USE_DBX']
开发者ID:CACloudAdmin,项目名称:scripts,代码行数:33,代码来源:chainonupdate.py

示例4:

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import createAndSetupReplica [as 别名]
if ipawinsync:
    configfile = ['/share/dswinsyncipa/testipawinsyncplugin.ldif']
    schemafile = ['/share/freeipa/freeipa/ipa-server/ipa-install/share/60ipaconfig.ldif',
                  '/share/freeipa/freeipa/ipa-server/ipa-install/share/60kerberos.ldif',
                  '/share/freeipa/freeipa/ipa-server/ipa-install/share/60radius.ldif']
else:
    configfile = []
    schemafile = []

os.environ['USE_VALGRIND'] = "1"
ds = DSAdmin.createAndSetupReplica({
	'newrootpw': rootpw1,
	'newhost': host1,
	'newport': port1,
	'newinst': 'ds',
	'newsuffix': suffix,
	'verbose': False,
    'no_admin': True,
    'ConfigFile': configfile,
    'SchemaFile': schemafile
}, replargs
)
os.environ['USE_VALGRIND'] = ''
os.environ.pop('USE_VALGRIND')
try:
    foo = os.environ['USE_VALGRIND']
except KeyError:
    print "should no longer have USE_VALGRIND env. var"

if ipawinsync:
    print "Enable the memberof plugin . . ."
    dn = "cn=MemberOf Plugin,cn=plugins,cn=config"
开发者ID:CACloudAdmin,项目名称:scripts,代码行数:34,代码来源:groupsync.py

示例5:

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import createAndSetupReplica [as 别名]
#os.environ['USE_DBX'] = "1"
m1replargs = {
	'suffix': "dc=example,dc=com",
	'bename': "userRoot",
	'binddn': "cn=replrepl,cn=config",
	'bindcn': "replrepl",
	'bindpw': "replrepl"
}

m1 = DSAdmin.createAndSetupReplica({
	'cfgdshost': host1,
	'cfgdsport': cfgport,
	'cfgdsuser': 'admin',
	'cfgdspwd': 'admin',
	'newrootpw': 'password',
	'newhost': host1,
	'newport': port1,
	'newinst': 'm1',
	'newsuffix': 'dc=example,dc=com',
	'verbose': True
}, m1replargs)
#del os.environ['USE_DBX']

m2replargs = {
	'suffix': "dc=example,dc=com",
	'bename': "userRoot",
	'binddn': "cn=replrepl,cn=config",
	'bindcn': "replrepl",
	'bindpw': "replrepl"
}
开发者ID:CACloudAdmin,项目名称:scripts,代码行数:32,代码来源:repladddel.py

示例6:

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import createAndSetupReplica [as 别名]
m1replargs = {
	'suffix': "dc=example,dc=com",
	'bename': "userRoot",
	'binddn': "cn=replrepl,cn=config",
	'bindcn': "replrepl",
	'bindpw': "replrepl",
    'log'   : True
}

#os.environ['USE_DBX'] = "1"
m1 = DSAdmin.createAndSetupReplica({
	'newrootpw': 'password',
	'newhost': host1,
	'newport': cfgport+10,
	'newinst': 'm1',
	'newsuffix': 'dc=example,dc=com',
	'verbose': True,
    'no_admin': True
}, m1replargs
)
#del os.environ['USE_DBX']

m2replargs = {
	'suffix': "dc=example,dc=com",
	'bename': "userRoot",
	'binddn': "cn=replrepl,cn=config",
	'bindcn': "replrepl",
	'bindpw': "replrepl"
}
#os.environ['USE_DBX'] = 1
m2 = DSAdmin.createAndSetupReplica({
开发者ID:CACloudAdmin,项目名称:scripts,代码行数:33,代码来源:bug233642-3.py

示例7:

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import createAndSetupReplica [as 别名]
m1replargs = {
	'suffix': suffix,
	'bename': "userRoot",
	'binddn': "cn=replrepl,cn=config",
	'bindcn': "replrepl",
	'bindpw': "replrepl",
    'log'   : True
}

#os.environ['USE_DBX'] = "1"
m1 = DSAdmin.createAndSetupReplica({
	'newrootpw': 'password',
	'newhost': host1,
	'newport': port1,
	'newinst': 'm1',
	'newsuffix': suffix,
	'verbose': True,
    'no_admin': True
}, m1replargs
)
#del os.environ['USE_DBX']

m2replargs = m1replargs
#os.environ['USE_DBX'] = 1
m2 = DSAdmin.createAndSetupReplica({
	'newrootpw': 'password',
	'newhost': host2,
	'newport': port2,
	'newinst': 'm2',
	'newsuffix': suffix,
	'verbose': True,
开发者ID:CACloudAdmin,项目名称:scripts,代码行数:33,代码来源:bug-dbbufsm.py

示例8:

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import createAndSetupReplica [as 别名]
    'ConfigFile': configfile,
    'no_admin': True
}

m1replargs = {
    'suffix': basedn,
    'bename': "userRoot",
    'binddn': "cn=replrepl,cn=config",
    'bindcn': "replrepl",
    'bindpw': "replrepl",
    'bindmethod': 'SASL/GSSAPI',
    'log'   : False
}

#os.environ['USE_GDB'] = "1"
m1 = DSAdmin.createAndSetupReplica(hostargs, m1replargs)
#del os.environ['USE_GDB']

hostargs['newhost'] = host2
hostargs['newport'] = port2
hostargs['newinst'] = 'm2'
m2replargs = m1replargs

m2 = DSAdmin.createAndSetupReplica(hostargs, m2replargs)

hostargs['newhost'] = host3
hostargs['newport'] = port3
hostargs['newinst'] = 'm3'
m3replargs = m2replargs

m3 = DSAdmin.createAndSetupReplica(hostargs, m3replargs)
开发者ID:CACloudAdmin,项目名称:scripts,代码行数:33,代码来源:bugreplgssapi.py

示例9:

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import createAndSetupReplica [as 别名]
cfgport = 1100

mreplargs = {
	'suffix': "dc=example,dc=com",
	'bename': "userRoot",
	'binddn': "cn=replrepl,cn=config",
	'bindcn': "replrepl",
	'bindpw': "replrepl"
}

#os.environ['USE_DBX'] = "1"
m = DSAdmin.createAndSetupReplica({
	'newrootpw': 'password',
	'newhost': host1,
	'newport': cfgport+10,
	'newinst': 'm',
	'newsuffix': 'dc=example,dc=com',
	'verbose': True,
    'no_admin': True
}, mreplargs
)
#del os.environ['USE_DBX']

hreplargs = {
	'suffix': "dc=example,dc=com",
	'bename': "userRoot",
	'binddn': "cn=replrepl,cn=config",
	'bindcn': "replrepl",
	'bindpw': "replrepl",
    'type'  : dsadmin.HUB_TYPE
}
#os.environ['USE_DBX'] = 1
开发者ID:CACloudAdmin,项目名称:scripts,代码行数:34,代码来源:it143434.py

示例10:

# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import createAndSetupReplica [as 别名]
        hostport.append((host, port))

basedn = "o=sasl.net"
replbinddn = "cn=replrepl,cn=config"
replargs = {"suffix": basedn, "bename": "userRoot", "binddn": replbinddn, "bindcn": "replrepl", "bindpw": "replrepl"}

srvs = []
rootdn = "cn=directory manager"
rootpw = "password"
for (host, port) in hostport:
    srv = DSAdmin.createAndSetupReplica(
        {
            "newrootpw": rootpw,
            "newhost": host,
            "newport": port,
            "newinst": "%s-%d" % (host, port),
            "newsuffix": basedn,
            "no_admin": True,
        },
        replargs,
    )
    srvs.append(srv)

print "create agreements and init consumers"
srv = srvs[0]
for xx in srvs:
    for yy in srvs:
        if xx == yy:
            continue
        agmt = xx.setupAgreement(yy, replargs)
        if xx == srv:
开发者ID:nkinder,项目名称:scripts,代码行数:33,代码来源:fourwaymmr.py


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