本文整理汇总了Python中appcontroller_client.AppControllerClient.deployment_id_exists方法的典型用法代码示例。如果您正苦于以下问题:Python AppControllerClient.deployment_id_exists方法的具体用法?Python AppControllerClient.deployment_id_exists怎么用?Python AppControllerClient.deployment_id_exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appcontroller_client.AppControllerClient
的用法示例。
在下文中一共展示了AppControllerClient.deployment_id_exists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_deployment_id_exists
# 需要导入模块: from appcontroller_client import AppControllerClient [as 别名]
# 或者: from appcontroller_client.AppControllerClient import deployment_id_exists [as 别名]
def test_deployment_id_exists(self):
# The function should return whatever run_with_timeout returns.
host = 'boo'
secret = 'baz'
deployment_id_exists = True
flexmock(AppControllerClient).should_receive('run_with_timeout')\
.and_return(deployment_id_exists)
acc = AppControllerClient(host, secret)
self.assertEqual(deployment_id_exists, acc.deployment_id_exists())
示例2: appscale_has_deployment_id
# 需要导入模块: from appcontroller_client import AppControllerClient [as 别名]
# 或者: from appcontroller_client.AppControllerClient import deployment_id_exists [as 别名]
def appscale_has_deployment_id(cls, head_node, keyname):
""" Try to retrieve a deployment ID from ZooKeeper to see if this
deployment has already been registered.
Args:
head_node: A string containing the IP address of the head node.
keyname: A string representing the SSH keypair name used for this
AppScale deployment.
Returns:
A boolean indicating whether the deployment ID exists or not.
"""
# Check if head node has a deployment ID stored.
secret = LocalState.get_secret_key(keyname)
acc = AppControllerClient(head_node, secret)
return acc.deployment_id_exists()