本文整理匯總了Python中fuelweb_test.models.nailgun_client.NailgunClient.provision_node方法的典型用法代碼示例。如果您正苦於以下問題:Python NailgunClient.provision_node方法的具體用法?Python NailgunClient.provision_node怎麽用?Python NailgunClient.provision_node使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類fuelweb_test.models.nailgun_client.NailgunClient
的用法示例。
在下文中一共展示了NailgunClient.provision_node方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: provision_cluster_separately
# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import provision_node [as 別名]
def provision_cluster_separately(admin_node_ip, env_name):
client = NailgunClient(admin_node_ip)
cluster_id = client.get_cluster_id(env_name)
env = load_env(env_name)
# separate provisioning, useful on virtual envs since provisioning runs much faster this way
cluster_nodes = client.list_cluster_nodes(cluster_id)
for cur_node in cluster_nodes:
task = client.provision_node(cluster_id, cur_node['id'])
result = task_wait(client, task, 3600, 60)
if result['status'] != 'ready':
return result['message']
return "OK"
示例2: provision_cluster
# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import provision_node [as 別名]
def provision_cluster(admin_node_ip, env_name):
client = NailgunClient(admin_node_ip)
cluster_id = client.get_cluster_id(env_name)
env = load_env(env_name)
all_nodes_ids = ""
# separate provisioning, useful on virtual envs since provisioning runs much faster this way
cluster_nodes = client.list_cluster_nodes(cluster_id)
for cur_node in cluster_nodes:
if all_nodes_ids == "":
all_nodes_ids = str(cur_node['id'])
else:
all_nodes_ids = all_nodes_ids + "," + str(cur_node['id'])
# provision all nodes
task = client.provision_node(cluster_id, all_nodes_ids)
result = task_wait(client, task, env.deploy_timeout, 30)
if result['status'] == 'ready':
return "OK"
else:
return result['message']