本文整理汇总了Python中nailgun.task.helpers.TaskHelper.update_cluster_status方法的典型用法代码示例。如果您正苦于以下问题:Python TaskHelper.update_cluster_status方法的具体用法?Python TaskHelper.update_cluster_status怎么用?Python TaskHelper.update_cluster_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nailgun.task.helpers.TaskHelper
的用法示例。
在下文中一共展示了TaskHelper.update_cluster_status方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_update_cluster_to_operational
# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import update_cluster_status [as 别名]
def test_update_cluster_to_operational(self):
task = Task(name='deploy', cluster=self.cluster, status='ready')
self.db.add(task)
self.db.commit()
TaskHelper.update_cluster_status(task.uuid)
self.assertEquals(self.cluster.status, 'operational')
示例2: test_update_cluster_to_error_if_deploy_task_failed
# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import update_cluster_status [as 别名]
def test_update_cluster_to_error_if_deploy_task_failed(self):
task = Task(name='deploy', cluster=self.cluster, status='error')
self.db.add(task)
self.db.commit()
TaskHelper.update_cluster_status(task.uuid)
self.assertEquals(self.cluster.status, 'error')
示例3: test_update_nodes_to_error_if_provision_task_failed
# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import update_cluster_status [as 别名]
def test_update_nodes_to_error_if_provision_task_failed(self):
self.cluster.nodes[0].status = 'provisioning'
self.cluster.nodes[0].progress = 12
task = Task(name='provision', cluster=self.cluster, status='error')
self.db.add(task)
self.db.commit()
TaskHelper.update_cluster_status(task.uuid)
self.assertEquals(self.cluster.status, 'error')
self.node_should_be_error_with_type(self.cluster.nodes[0], 'provision')
self.nodes_should_not_be_error(self.cluster.nodes[1:])
示例4: test_do_not_set_cluster_to_error_if_validation_failed
# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import update_cluster_status [as 别名]
def test_do_not_set_cluster_to_error_if_validation_failed(self):
for task_name in ['check_before_deployment', 'check_networks']:
supertask = Task(
name='deploy',
cluster=self.cluster,
status='error')
check_task = Task(
name=task_name,
cluster=self.cluster,
status='error')
supertask.subtasks.append(check_task)
self.db.add(check_task)
self.db.commit()
TaskHelper.update_cluster_status(supertask.uuid)
self.assertEquals(self.cluster.status, 'new')
示例5: test_update_if_parent_task_is_ready_all_nodes_should_be_ready
# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import update_cluster_status [as 别名]
def test_update_if_parent_task_is_ready_all_nodes_should_be_ready(self):
for node in self.cluster.nodes:
node.status = 'ready'
node.progress = 100
self.cluster.nodes[0].status = 'deploying'
self.cluster.nodes[0].progress = 24
task = Task(name='deploy', cluster=self.cluster, status='ready')
self.db.add(task)
self.db.commit()
TaskHelper.update_cluster_status(task.uuid)
self.assertEquals(self.cluster.status, 'operational')
for node in self.cluster.nodes:
self.assertEquals(node.status, 'ready')
self.assertEquals(node.progress, 100)