本文整理汇总了Python中lib389.DirSrv.exists方法的典型用法代码示例。如果您正苦于以下问题:Python DirSrv.exists方法的具体用法?Python DirSrv.exists怎么用?Python DirSrv.exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib389.DirSrv
的用法示例。
在下文中一共展示了DirSrv.exists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
# Create the master instance
master = DirSrv(verbose=False)
master.log.debug("Master allocated")
args = {SER_HOST: HOST_MASTER,
SER_PORT: PORT_MASTER,
SER_SERVERID_PROP: SERVERID_MASTER}
master.allocate(args)
if master.exists():
master.delete()
master.create()
master.open()
# Create the consumer instance
consumer = DirSrv(verbose=False)
consumer.log.debug("Consumer allocated")
args = {SER_HOST: HOST_CONSUMER,
SER_PORT: PORT_CONSUMER,
SER_SERVERID_PROP: SERVERID_CONSUMER}
consumer.allocate(args)
if consumer.exists():
consumer.delete()
consumer.create()
consumer.open()
# Delete each instance in the end
def fin():
master.delete()
consumer.delete()
request.addfinalizer(fin)
return TopologyReplication(master, consumer)
示例2: setUp
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def setUp(self):
# Create the master instance
master = DirSrv(verbose=False)
master.log.debug("Master allocated")
args = {SER_HOST: HOST_MASTER,
SER_PORT: PORT_MASTER,
SER_DEPLOYED_DIR: INSTANCE_PREFIX,
SER_SERVERID_PROP: SERVERID_MASTER
}
master.allocate(args)
if master.exists():
master.delete()
master.create()
master.open()
self.master = master
# Create the consumer instance
consumer = DirSrv(verbose=False)
consumer.log.debug("Consumer allocated")
args = {SER_HOST: HOST_CONSUMER,
SER_PORT: PORT_CONSUMER,
SER_DEPLOYED_DIR: INSTANCE_PREFIX,
SER_SERVERID_PROP: SERVERID_CONSUMER
}
consumer.allocate(args)
if consumer.exists():
consumer.delete()
consumer.create()
consumer.open()
self.consumer = consumer
示例3: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
return
# Create the realm first
krb = MitKrb5(realm=REALM)
if krb.check_realm():
krb.destroy_realm()
krb.create_realm()
DEBUG = False
# Creating master 1...
master1 = DirSrv(verbose=DEBUG)
args_instance[SER_HOST] = HOST_MASTER_1
args_instance[SER_PORT] = PORT_MASTER_1
args_instance[SER_SERVERID_PROP] = SERVERID_MASTER_1
args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX
args_instance[SER_REALM] = REALM
args_instance[SER_STRICT_HOSTNAME_CHECKING] = False
args_master = args_instance.copy()
master1.allocate(args_master)
instance_master1 = master1.exists()
if instance_master1:
master1.delete()
master1.create() # There is some magic in .create that finds the realm, and adds the keytab for us.
master1.open()
master1.replica.enableReplication(suffix=SUFFIX, role=REPLICAROLE_MASTER, replicaId=REPLICAID_MASTER_1)
# Creating master 2...
master2 = DirSrv(verbose=DEBUG)
args_instance[SER_HOST] = HOST_MASTER_2
args_instance[SER_PORT] = PORT_MASTER_2
args_instance[SER_SERVERID_PROP] = SERVERID_MASTER_2
args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX
args_instance[SER_REALM] = REALM
args_instance[SER_STRICT_HOSTNAME_CHECKING] = False
args_master = args_instance.copy()
master2.allocate(args_master)
instance_master2 = master2.exists()
if instance_master2:
master2.delete()
master2.create()
master2.open()
master2.replica.enableReplication(suffix=SUFFIX, role=REPLICAROLE_MASTER, replicaId=REPLICAID_MASTER_2)
# Delete each instance in the end
def fin():
master1.delete()
master2.delete()
if krb.check_realm():
krb.destroy_realm()
request.addfinalizer(fin)
# Clear out the tmp dir
master1.clearTmpDir(__file__)
return TopologyReplication(master1, master2)
示例4: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
'''
This fixture is used to standalone topology for the 'module'.
At the beginning, It may exists a standalone instance.
It may also exists a backup for the standalone instance.
'''
standalone = DirSrv(verbose=False)
# Args for the standalone instance
args_instance[SER_HOST] = HOST_STANDALONE
args_instance[SER_PORT] = PORT_STANDALONE
args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
args_standalone = args_instance.copy()
standalone.allocate(args_standalone)
# Get the status of the instance and restart it if it exists
instance_standalone = standalone.exists()
if instance_standalone:
standalone.delete()
# Create the instance
standalone.create()
# Used to retrieve configuration information (dbdir, confdir...)
standalone.open()
def fin():
standalone.delete()
request.addfinalizer(fin)
return TopologyStandalone(standalone)
示例5: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
# Creating standalone instance ...
standalone = DirSrv(verbose=False)
args_instance[SER_HOST] = HOST_STANDALONE
args_instance[SER_PORT] = PORT_STANDALONE
args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX
args_standalone = args_instance.copy()
standalone.allocate(args_standalone)
instance_standalone = standalone.exists()
if instance_standalone:
standalone.delete()
standalone.create()
standalone.open()
# Delete each instance in the end
def fin():
standalone.delete()
request.addfinalizer(fin)
# Clear out the tmp dir
standalone.clearTmpDir(__file__)
return TopologyStandalone(standalone)
示例6: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
global installation1_prefix
if installation1_prefix:
args_instance[SER_DEPLOYED_DIR] = installation1_prefix
# Creating standalone instance ...
standalone = DirSrv(verbose=False)
args_instance[SER_HOST] = HOST_STANDALONE
args_instance[SER_PORT] = PORT_STANDALONE
args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX
args_standalone = args_instance.copy()
standalone.allocate(args_standalone)
instance_standalone = standalone.exists()
if instance_standalone:
standalone.delete()
standalone.create()
standalone.open()
def fin():
standalone.delete()
request.addfinalizer(fin)
return TopologyStandalone(standalone)
示例7: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
'''
This fixture is used to standalone topology for the 'module'.
'''
standalone = DirSrv(verbose=True)
# Args for the standalone instance
args_instance[SER_HOST] = HOST_STANDALONE
args_instance[SER_PORT] = PORT_STANDALONE
args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
args_standalone = args_instance.copy()
standalone.allocate(args_standalone)
# Get the status of the instance and restart it if it exists
instance_standalone = standalone.exists()
# Remove the instance
if instance_standalone:
standalone.delete()
# Create the instance
standalone.create()
# Used to retrieve configuration information (dbdir, confdir...)
standalone.open()
# clear the tmp directory
standalone.clearTmpDir(__file__)
# Here we have standalone instance up and running
return TopologyStandalone(standalone)
示例8: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
global installation1_prefix
if installation1_prefix:
args_instance[SER_DEPLOYED_DIR] = installation1_prefix
# Creating standalone instance ...
standalone = DirSrv(verbose=False)
args_instance[SER_HOST] = HOST_STANDALONE
args_instance[SER_PORT] = PORT_STANDALONE
args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX
args_standalone = args_instance.copy()
standalone.allocate(args_standalone)
instance_standalone = standalone.exists()
if instance_standalone:
standalone.delete()
standalone.create()
standalone.open()
# Clear out the tmp dir
standalone.clearTmpDir(__file__)
def fin():
standalone.delete()
sbin_dir = standalone.get_sbin_dir()
if not standalone.has_asan():
valgrind_disable(sbin_dir)
request.addfinalizer(fin)
return TopologyStandalone(standalone)
示例9: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
# Creating standalone instance ...
standalone = DirSrv(verbose=False)
args_instance[SER_HOST] = HOST_STANDALONE
args_instance[SER_PORT] = PORT_STANDALONE
args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX
args_standalone = args_instance.copy()
standalone.allocate(args_standalone)
instance_standalone = standalone.exists()
if instance_standalone:
standalone.delete()
standalone.create()
standalone.open()
# Delete each instance in the end
def fin():
# This is useful for analysing the test env.
standalone.db2ldif(bename=DEFAULT_BENAME, suffixes=[DEFAULT_SUFFIX], excludeSuffixes=[], encrypt=False, \
repl_data=True, outputfile='%s/ldif/%s.ldif' % (standalone.dbdir,SERVERID_STANDALONE ))
standalone.clearBackupFS()
standalone.backupFS()
standalone.delete()
request.addfinalizer(fin)
# Clear out the tmp dir
standalone.clearTmpDir(__file__)
return TopologyStandalone(standalone)
示例10: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
"""
This fixture is used to create a DirSrv instance for the 'module'.
"""
schemainst = DirSrv(verbose=False)
# Args for the master instance
args_instance[SER_HOST] = HOST_STANDALONE
args_instance[SER_PORT] = PORT_STANDALONE
args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
schemainst.allocate(args_instance)
# Remove all the instance
if schemainst.exists():
schemainst.delete()
# Create the instance
schemainst.create()
schemainst.open()
def fin():
schemainst.delete()
request.addfinalizer(fin)
return TopologyStandalone(schemainst)
示例11: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
"""This fixture is used to standalone topology for the 'module'."""
standalone = DirSrv(verbose=False)
# Args for the standalone instance
args_instance[SER_HOST] = HOST_STANDALONE
args_instance[SER_PORT] = PORT_STANDALONE
args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
args_standalone = args_instance.copy()
standalone.allocate(args_standalone)
# Get the status of the instance and restart it if it exists
instance_standalone = standalone.exists()
# Remove the instance
if instance_standalone:
standalone.delete()
# Create the instance
standalone.create()
# Used to retrieve configuration information (dbdir, confdir...)
standalone.open()
# Delete each instance in the end
def fin():
standalone.delete()
request.addfinalizer(fin)
# Here we have standalone instance up and running
return TopologyStandalone(standalone)
示例12: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
"""Create DS Deployment"""
# Creating standalone instance ...
if DEBUGGING:
standalone = DirSrv(verbose=True)
else:
standalone = DirSrv(verbose=False)
args_instance[SER_HOST] = HOST_STANDALONE
args_instance[SER_PORT] = PORT_STANDALONE
args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX
args_standalone = args_instance.copy()
standalone.allocate(args_standalone)
instance_standalone = standalone.exists()
if instance_standalone:
standalone.delete()
standalone.create()
standalone.open()
def fin():
"""If we are debugging just stop the instances, otherwise remove
them
"""
if DEBUGGING:
standalone.stop(60)
else:
standalone.delete()
request.addfinalizer(fin)
# Clear out the tmp dir
standalone.clearTmpDir(__file__)
return TopologyStandalone(standalone)
示例13: topology
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def topology(request):
# Master
#
# Create the master instance
master = DirSrv(verbose=False)
master.log.debug("Master allocated")
args = {SER_HOST: HOST_MASTER,
SER_PORT: PORT_MASTER,
SER_SERVERID_PROP: SERVERID_MASTER}
master.allocate(args)
if master.exists():
master.delete()
master.create()
master.open()
# Enable replication
master.replica.enableReplication(suffix=SUFFIX,
role=REPLICAROLE_MASTER,
replicaId=REPLICAID_MASTER)
# Consumer
#
# Create the consumer instance
consumer = DirSrv(verbose=False)
consumer.log.debug("Consumer allocated")
args = {SER_HOST: HOST_CONSUMER,
SER_PORT: PORT_CONSUMER,
SER_SERVERID_PROP: SERVERID_CONSUMER}
consumer.allocate(args)
if consumer.exists():
consumer.delete()
consumer.create()
consumer.open()
# Enable replication
consumer.replica.enableReplication(suffix=SUFFIX,
role=REPLICAROLE_CONSUMER)
# Delete each instance in the end
def fin():
master.delete()
consumer.delete()
request.addfinalizer(fin)
return TopologyReplication(master, consumer)
示例14: setUp
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def setUp(self):
#
# Master
#
# Create the master instance
master = DirSrv(verbose=False)
master.log.debug("Master allocated")
args = {SER_HOST: HOST_MASTER,
SER_PORT: PORT_MASTER,
SER_DEPLOYED_DIR: INSTANCE_PREFIX,
SER_SERVERID_PROP: SERVERID_MASTER
}
master.allocate(args)
if master.exists():
master.delete()
master.create()
master.open()
# enable replication
master.replica.enableReplication(suffix=SUFFIX, role=REPLICAROLE_MASTER, replicaId=REPLICAID_MASTER)
self.master = master
#
# Consumer
#
# Create the consumer instance
consumer = DirSrv(verbose=False)
consumer.log.debug("Consumer allocated")
args = {SER_HOST: HOST_CONSUMER,
SER_PORT: PORT_CONSUMER,
SER_DEPLOYED_DIR: INSTANCE_PREFIX,
SER_SERVERID_PROP: SERVERID_CONSUMER
}
consumer.allocate(args)
if consumer.exists():
consumer.delete()
consumer.create()
consumer.open()
# enable replication
consumer.replica.enableReplication(suffix=SUFFIX, role=REPLICAROLE_CONSUMER)
self.consumer = consumer
示例15: test_finalizer
# 需要导入模块: from lib389 import DirSrv [as 别名]
# 或者: from lib389.DirSrv import exists [as 别名]
def test_finalizer():
# for each defined instance, remove it
for args_instance in ALL_INSTANCES:
instance = DirSrv(verbose=True)
instance.allocate(args_instance)
if instance.exists():
instance.delete()
# remove any existing backup for this instance
instance.clearBackupFS()