当前位置: 首页>>代码示例>>Python>>正文


Python TaskHelper.nodes_to_delete方法代码示例

本文整理汇总了Python中nailgun.task.helpers.TaskHelper.nodes_to_delete方法的典型用法代码示例。如果您正苦于以下问题:Python TaskHelper.nodes_to_delete方法的具体用法?Python TaskHelper.nodes_to_delete怎么用?Python TaskHelper.nodes_to_delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nailgun.task.helpers.TaskHelper的用法示例。


在下文中一共展示了TaskHelper.nodes_to_delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_deploy_shrink_controllers

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import nodes_to_delete [as 别名]
    def test_deploy_shrink_controllers(self):
        cluster = self.create_env(
            nodes_kwargs=[
                {'roles': ['controller']},
                {'roles': ['controller'], 'pending_deletion': True},
                {'roles': ['controller'], 'pending_deletion': True}])

        # Check that we are deleting 2 controllers
        d_nodes = TaskHelper.nodes_to_delete(cluster)
        self.assertEqual(len(d_nodes), 2)

        supertask = self.env.launch_deployment()
        self.assertEqual(supertask.name, consts.TASK_NAMES.deploy)
        self.assertNotEqual(supertask.status, consts.TASK_STATUSES.error)

        controllers = self.filter_by_role(cluster.nodes, 'controller')
        self.assertEqual(len(controllers), 1)
开发者ID:ekorekin,项目名称:fuel-web,代码行数:19,代码来源:test_cluster_scaling.py

示例2: test_deletion_offline_node

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import nodes_to_delete [as 别名]
    def test_deletion_offline_node(self):
        self.env.create(
            nodes_kwargs=[
                {"online": False, "pending_deletion": True},
                {"status": "ready"}
            ]
        )

        to_delete = TaskHelper.nodes_to_delete(self.env.clusters[0])
        to_delete_ids = [node.id for node in to_delete]
        self.assertEqual(len(to_delete_ids), 1)

        supertask = self.env.launch_deployment()
        self.env.wait_ready(supertask, timeout=5)

        self.assertEqual(self.env.db.query(models.Node).count(), 1)
        remaining_node = self.env.db.query(models.Node).first()
        self.assertNotIn(remaining_node.id, to_delete_ids)
开发者ID:ibelikov,项目名称:fuel-web,代码行数:20,代码来源:test_task_managers.py

示例3: test_deploy_shrink_controllers

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import nodes_to_delete [as 别名]
    def test_deploy_shrink_controllers(self):
        cluster = self.create_env(
            nodes_kwargs=[
                {'roles': ['controller']},
                {'roles': ['controller'], 'pending_deletion': True},
                {'roles': ['controller'], 'pending_deletion': True}])

        # Check that we are deleting 2 controllers
        d_nodes = TaskHelper.nodes_to_delete(cluster)
        self.assertEquals(len(d_nodes), 2)

        supertask = self.env.launch_deployment()
        self.assertEquals(supertask.name, 'deploy')

        self.env.wait_ready(supertask)
        self.assertEquals(supertask.status, 'ready')

        controllers = self.filter_by_role(cluster.nodes, 'controller')
        self.assertEquals(len(controllers), 1)
开发者ID:Mellanox,项目名称:fuel-web,代码行数:21,代码来源:test_cluster_scaling.py

示例4: test_deploy_shrink_controllers

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import nodes_to_delete [as 别名]
    def test_deploy_shrink_controllers(self):
        cluster = self.create_env(
            nodes_kwargs=[
                {"roles": ["controller"]},
                {"roles": ["controller"], "pending_deletion": True},
                {"roles": ["controller"], "pending_deletion": True},
            ]
        )

        # Check that we are deleting 2 controllers
        d_nodes = TaskHelper.nodes_to_delete(cluster)
        self.assertEqual(len(d_nodes), 2)

        supertask = self.env.launch_deployment()
        self.assertEqual(supertask.name, "deploy")

        self.env.wait_ready(supertask)
        self.assertEqual(supertask.status, "ready")

        controllers = self.filter_by_role(cluster.nodes, "controller")
        self.assertEqual(len(controllers), 1)
开发者ID:mba811,项目名称:fuel-web,代码行数:23,代码来源:test_cluster_scaling.py

示例5: get_task_nodes_for_cluster

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import nodes_to_delete [as 别名]
 def get_task_nodes_for_cluster(cls, cluster):
     return cls.prepare_nodes_for_task(TaskHelper.nodes_to_delete(cluster))
开发者ID:vefimova,项目名称:fuel-web,代码行数:4,代码来源:task.py


注:本文中的nailgun.task.helpers.TaskHelper.nodes_to_delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。