本文整理汇总了Python中tests.util.create_dbaas_client函数的典型用法代码示例。如果您正苦于以下问题:Python create_dbaas_client函数的具体用法?Python create_dbaas_client怎么用?Python create_dbaas_client使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_dbaas_client函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
"""Sets up the client."""
global dbaas
global dbaas_admin
# TODO(rnirmal): We need to better split out the regular client and
# the admin client
reqs = Requirements(is_admin=False)
instance_info.user = test_config.users.find_user(reqs)
instance_info.dbaas = create_dbaas_client(instance_info.user)
if WHITE_BOX:
instance_info.nova_client = create_nova_client(instance_info.user)
instance_info.volume_client = create_nova_client(instance_info.user,
service_type="volume_service_type")
dbaas = instance_info.dbaas
reqs = Requirements(is_admin=True)
instance_info.admin_user = test_config.users.find_user(reqs)
instance_info.dbaas_admin = create_dbaas_client(
instance_info.admin_user)
dbaas_admin = instance_info.dbaas_admin
if WHITE_BOX:
user = instance_info.user.auth_user
tenant = instance_info.user.tenant
instance_info.user_context = context.RequestContext(user, tenant)
开发者ID:cp16net,项目名称:reddwarf_lite-integration,代码行数:26,代码来源:instances.py
示例2: setUp
def setUp(self):
self.dbaas = util.create_dbaas_client(instance_info.user)
self.dbaas_admin = util.create_dbaas_client(instance_info.admin_user)
databases = [{"name": self.db1, "charset": "latin2", "collate": "latin2_general_ci"}, {"name": self.db2}]
self.dbaas.databases.create(instance_info.id, databases)
if not FAKE:
time.sleep(5)
开发者ID:TimSimpsonR,项目名称:reddwarf_lite-integration,代码行数:7,代码来源:users.py
示例3: setUp
def setUp(self):
"""Sets up the client."""
reqs = Requirements(is_admin=True)
instance_info.admin_user = test_config.users.find_user(reqs)
instance_info.dbaas_admin = create_dbaas_client(
instance_info.admin_user)
dbaas_admin = instance_info.dbaas_admin
# Make sure we create the client as the correct user if we're using
# a pre-built instance.
if existing_instance():
mgmt_instance = dbaas_admin.mgmt.instances.show(existing_instance())
t_id = mgmt_instance.tenant_id
instance_info.user = test_config.users.find_user_by_tenant_id(t_id)
else:
reqs = Requirements(is_admin=False)
instance_info.user = test_config.users.find_user(reqs)
instance_info.dbaas = create_dbaas_client(instance_info.user)
if WHITE_BOX:
instance_info.nova_client = create_nova_client(instance_info.user)
instance_info.volume_client = create_nova_client(instance_info.user,
service_type=test_config.nova_client['volume_service_type'])
dbaas = instance_info.dbaas
if WHITE_BOX:
user = instance_info.user.auth_user
tenant = instance_info.user.tenant
instance_info.user_context = context.RequestContext(user, tenant)
开发者ID:sacharya,项目名称:reddwarf_lite-integration,代码行数:30,代码来源:instances.py
示例4: setUp
def setUp(self):
self.admin_user = test_config.users.find_user(Requirements(is_admin=True))
self.admin_client = create_dbaas_client(self.admin_user)
self.admin_context = context.RequestContext(self.admin_user.auth_user, self.admin_user.tenant)
self.user = test_config.users.find_user(Requirements(is_admin=False))
self.client = create_dbaas_client(self.user)
self.context = context.RequestContext(self.user.auth_user, self.user.tenant)
开发者ID:rnirmal,项目名称:reddwarf_lite-integration,代码行数:8,代码来源:instances.py
示例5: setUp
def setUp(self):
self.dbaas = util.create_dbaas_client(instance_info.user)
self.dbaas_admin = util.create_dbaas_client(instance_info.admin_user)
databases = [{"name": self.db1, "charset": "latin2",
"collate": "latin2_general_ci"},
{"name": self.db2}]
try:
self.dbaas.databases.create(instance_info.id, databases)
except nova_exceptions.BadRequest:
pass # If the db already exists that's OK.
if not FAKE:
time.sleep(5)
开发者ID:cp16net,项目名称:reddwarf_lite-integration,代码行数:12,代码来源:users.py
示例6: setUp
def setUp(self):
nova_user = test_config.users.find_user(
Requirements(is_admin=False, services=["nova"]))
rd_user = test_config.users.find_user(
Requirements(is_admin=False, services=["reddwarf"]))
self.nova_client = create_nova_client(nova_user)
self.rd_client = create_dbaas_client(rd_user)
开发者ID:DJohnstone,项目名称:reddwarf_lite-integration,代码行数:7,代码来源:flavors.py
示例7: delete_all
def delete_all():
"""Delete every single one."""
user = test_config.users.find_user(Requirements(is_admin=True))
dbaas = create_dbaas_client(user)
instances = dbaas.instances.list()
for instance in instances:
instance.delete()
开发者ID:TimSimpsonR,项目名称:reddwarf_lite-integration,代码行数:7,代码来源:delete_all.py
示例8: setUp
def setUp(self):
rd_user = test_config.users.find_user(Requirements(is_admin=False, services=["reddwarf"]))
self.rd_client = create_dbaas_client(rd_user)
if test_config.nova_client is None:
raise SkipTest("Skipping this test as no info to communicate with " "Nova was found in the test config.")
nova_user = test_config.users.find_user(Requirements(is_admin=False, services=["nova"]))
self.nova_client = create_nova_client(nova_user)
开发者ID:jcru,项目名称:docs-cloud-databases,代码行数:8,代码来源:flavors.py
示例9: setUp
def setUp(self):
admin_req = Requirements(is_admin=True)
self.admin_user = test_config.users.find_user(admin_req)
self.admin_client = create_dbaas_client(self.admin_user)
user_req = Requirements(is_admin=False)
self.users = test_config.users.find_all_users_who_satisfy(user_req)
self.user_tenant_ids = [user.tenant_id for user in self.users]
self._create_instances_for_users()
开发者ID:0xdc,项目名称:docs-cloud-databases,代码行数:8,代码来源:accounts.py
示例10: login
def login():
"""
This super simple test just logs in.
Its useful when running tests in a new environment to troubleshoot
connection problems.
"""
reqs = Requirements(is_admin=False)
user = test_config.users.find_user(reqs)
dbaas = create_dbaas_client(user)
dbaas.instances.list()
开发者ID:cweidenkeller,项目名称:reddwarf-integration,代码行数:10,代码来源:login.py
示例11: setUp
def setUp():
"""Set up vars needed by this story."""
user = test_config.users.find_user(Requirements(is_admin=True))
global client
client = create_dbaas_client(user)
flavors = client.find_flavors_by_ram(ram=8192)
assert_true(len(flavors) >= 1, "No flavor found!")
flavor = flavors[0]
global flavor_href
flavor_href = client.find_flavor_self_href(flavor)
global original_notification_count
original_notification_count = out_of_instance_memory_nofication_count()
开发者ID:cp16net,项目名称:trove-integration,代码行数:12,代码来源:driver.py
示例12: mgmt_instance_get
def mgmt_instance_get():
""" Tests the mgmt instances index method. """
reqs = Requirements(is_admin=True)
user = test_config.users.find_user(reqs)
client = create_dbaas_client(user)
mgmt = client.management
# Grab the info.id created by the main instance test which is stored in
# a global.
id = instance_info.id
api_instance = mgmt.show(id)
# Print out all fields for extra info if the test fails.
for name in dir(api_instance):
print(str(name) + "=" + str(getattr(api_instance, name)))
with TypeCheck("instance", api_instance) as instance:
instance.has_field('created', basestring)
instance.has_field('deleted', bool)
# If the instance hasn't been deleted, this should be false... but
# lets avoid creating more ordering work.
instance.has_field('deleted_at', (basestring, None))
instance.has_field('flavor', dict, flavor_check)
instance.has_field('guest_status', dict, guest_status_check)
instance.has_field('id', basestring)
instance.has_field('links', list)
instance.has_field('name', basestring)
#instance.has_field('server_status', basestring)
instance.has_field('status', basestring)
instance.has_field('tenant_id', basestring)
instance.has_field('updated', basestring)
# Can be None if no volume is given on this instance.
if test_config.values['reddwarf_main_instance_has_volume']:
instance.has_field('volume', dict, volume_check)
else:
instance.has_field('volume', None)
#TODO: Validate additional fields, assert no extra fields exist.
with CollectionCheck("server", api_instance.server) as server:
server.has_element("addresses", dict)
server.has_element("deleted", bool)
server.has_element("deleted_at", (basestring, None))
server.has_element("host", basestring)
server.has_element("id", basestring)
server.has_element("local_id", int)
server.has_element("name", basestring)
server.has_element("status", basestring)
server.has_element("tenant_id", basestring)
with CollectionCheck("volume", api_instance.volume) as volume:
volume.has_element("attachments", list)
volume.has_element("availability_zone", basestring)
volume.has_element("created_at", (basestring, None))
volume.has_element("id", basestring)
volume.has_element("size", int)
volume.has_element("status", basestring)
开发者ID:0xdc,项目名称:docs-cloud-databases,代码行数:52,代码来源:instances.py
示例13: setUp
def setUp(self):
"""Sets up the client."""
global dbaas
global dbaas_admin
# TODO(rnirmal): We need to better split out the regular client and
# the admin client
instance_info.user = test_config.users.find_user(Requirements(is_admin=False))
instance_info.dbaas = create_dbaas_client(instance_info.user)
nova_user = test_config.users.find_user(
Requirements(is_admin=False, services=["nova"]))
self.nova_client = create_nova_client(nova_user)
dbaas = instance_info.dbaas
instance_info.admin_user = test_config.users.find_user(Requirements(is_admin=True))
instance_info.dbaas_admin = create_dbaas_client(instance_info.admin_user)
dbaas_admin = instance_info.dbaas_admin
if WHITE_BOX:
instance_info.user_context = context.RequestContext(instance_info.user.auth_user,
instance_info.user.tenant)
开发者ID:imsplitbit,项目名称:reddwarf_lite-integration,代码行数:22,代码来源:instances.py
示例14: _delete_instances_for_users
def _delete_instances_for_users(self):
for user in self.users:
user_client = create_dbaas_client(user)
while True:
deleted_count = 0
user_instances = user_client.instances.list()
for instance in user_instances:
try:
instance.delete()
except exceptions.NotFound:
deleted_count += 1
except Exception:
print "Failed to delete instance"
if deleted_count == len(user_instances):
break
开发者ID:0xdc,项目名称:docs-cloud-databases,代码行数:15,代码来源:accounts.py
示例15: setUp
def setUp(self):
"""Sets up the client."""
user = test_config.users.find_user(Requirements(is_admin=False))
self.client = create_dbaas_client(user)
开发者ID:TimSimpsonR,项目名称:reddwarf_lite-integration,代码行数:4,代码来源:versions.py
示例16: setUp
def setUp(self):
self.dbaas = util.create_dbaas_client(instance_info.user)
self.dbaas_admin = util.create_dbaas_client(instance_info.admin_user)
开发者ID:TimSimpsonR,项目名称:reddwarf_lite-integration,代码行数:3,代码来源:databases.py
示例17: set_up
def set_up(self):
reqs = Requirements(is_admin=True)
self.user = test_config.users.find_user(reqs)
self.dbaas = create_dbaas_client(self.user)
开发者ID:cp16net,项目名称:trove-integration,代码行数:4,代码来源:update_hosts.py
示例18: setUp
def setUp(self):
self.user = test_config.users.find_user(Requirements(is_admin=True))
self.client = create_dbaas_client(self.user)
开发者ID:TimSimpsonR,项目名称:reddwarf_lite-integration,代码行数:3,代码来源:storage.py
示例19: test_index_detail_match_for_regular_user
def test_index_detail_match_for_regular_user(self):
user = test_config.users.find_user(Requirements(is_admin=False))
dbaas = create_dbaas_client(user)
details = [instance.id for instance in dbaas.instances.list()]
index = [instance.id for instance in dbaas.instances.index()]
assert_equal(sorted(details), sorted(index))
开发者ID:imsplitbit,项目名称:reddwarf_lite-integration,代码行数:6,代码来源:instances.py
示例20: set_up
def set_up(self):
"""Create a ton of instances."""
reqs = Requirements(is_admin=False)
self.user = test_config.users.find_user(reqs)
self.dbaas = create_dbaas_client(self.user)
开发者ID:0xdc,项目名称:docs-cloud-databases,代码行数:5,代码来源:create_11.py
注:本文中的tests.util.create_dbaas_client函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论