本文整理汇总了Python中trove.tests.api.instances.instance_info.get_address函数的典型用法代码示例。如果您正苦于以下问题:Python get_address函数的具体用法?Python get_address怎么用?Python get_address使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_address函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: show_databases
def show_databases(self, user, password):
print("Going to connect to %s, %s, %s"
% (instance_info.get_address(), user, password))
with util.mysql_connection().create(instance_info.get_address(),
user, password) as db:
print(db)
dbs = db.execute("show databases")
return [row['Database'] for row in dbs]
开发者ID:NeCTAR-RC,项目名称:trove,代码行数:8,代码来源:users.py
示例2: _check_mysql_connection
def _check_mysql_connection(self, username, password, success=True):
# This can only test connections for users with the host %.
# Much more difficult to simulate connection attempts from other hosts.
if FAKE:
# "Fake mode; cannot test mysql connection."
return
conn = util.mysql_connection()
if success:
conn.create(username, password, instance_info.get_address())
else:
conn.assert_fails(username, password, instance_info.get_address())
开发者ID:CiscoSystems,项目名称:openstack-trove,代码行数:12,代码来源:user_access.py
示例3: _check_connection
def _check_connection(self, username, password):
if not FAKE:
util.mysql_connection().assert_fails(username, password, instance_info.get_address())
# Also determine the db is gone via API.
result = self.dbaas.users.list(instance_info.id)
assert_equal(200, self.dbaas.last_http_code)
for item in result:
if item.name == username:
fail("User %s was not deleted." % username)
开发者ID:niuzhenguo,项目名称:trove,代码行数:9,代码来源:users.py
示例4: set_up
def set_up(self):
"""If you're using this as a base class, call this method first."""
self.dbaas = instance_info.dbaas
if USE_IP:
address = instance_info.get_address()
self.connection = MySqlConnection(address)
开发者ID:ReVolly,项目名称:trove,代码行数:6,代码来源:instances_actions.py
示例5: instance_address
def instance_address(self):
return instance_info.get_address()
开发者ID:ReVolly,项目名称:trove,代码行数:2,代码来源:instances_actions.py
示例6: log_in_as_root
def log_in_as_root(root_password):
con = create_mysql_connection(instance_info.get_address(), 'root',
root_password)
return con
开发者ID:dfecker,项目名称:trove,代码行数:4,代码来源:root.py
示例7: test_mysql_root
def test_mysql_root(self):
"""Ensure we aren't allowed access with root and wrong password."""
util.mysql_connection().assert_fails(
instance_info.get_address(), "root", "dsfgnear")
开发者ID:AlexeyDeyneko,项目名称:trove,代码行数:4,代码来源:databases.py
示例8: test_mysql_admin
def test_mysql_admin(self):
"""Ensure we aren't allowed access with os_admin and wrong password."""
util.mysql_connection().assert_fails(
instance_info.get_address(), "os_admin", "asdfd-asdf234")
开发者ID:AlexeyDeyneko,项目名称:trove,代码行数:4,代码来源:databases.py
注:本文中的trove.tests.api.instances.instance_info.get_address函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论