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


Python NailgunReceiver.stop_deployment_resp方法代码示例

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


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

示例1: test_stop_provisioning

# 需要导入模块: from nailgun.rpc.receiver import NailgunReceiver [as 别名]
# 或者: from nailgun.rpc.receiver.NailgunReceiver import stop_deployment_resp [as 别名]
    def test_stop_provisioning(self, _):
        provision_task = self.env.launch_provisioning_selected(
            self.node_uids
        )
        provision_task_uuid = provision_task.uuid
        NailgunReceiver.provision_resp(
            task_uuid=provision_task.uuid,
            status=consts.TASK_STATUSES.running,
            progress=50,
        )

        stop_task = self.env.stop_deployment()
        NailgunReceiver.stop_deployment_resp(
            task_uuid=stop_task.uuid,
            status=consts.TASK_STATUSES.ready,
            progress=100,
            nodes=[{'uid': n.uid} for n in self.env.nodes],
        )
        self.assertEqual(stop_task.status, consts.TASK_STATUSES.ready)
        self.assertTrue(self.db().query(Task).filter_by(
            uuid=provision_task_uuid
        ).first())
        self.assertIsNone(objects.Task.get_by_uuid(provision_task_uuid))

        self.assertEqual(self.cluster.status, consts.CLUSTER_STATUSES.stopped)
        self.assertEqual(stop_task.progress, 100)
        self.assertFalse(self.cluster.is_locked)
开发者ID:ogelbukh,项目名称:fuel-web,代码行数:29,代码来源:test_stop_deployment.py

示例2: test_stop_deployment

# 需要导入模块: from nailgun.rpc.receiver import NailgunReceiver [as 别名]
# 或者: from nailgun.rpc.receiver.NailgunReceiver import stop_deployment_resp [as 别名]
    def test_stop_deployment(self):
        supertask = self.env.launch_deployment()
        self.assertEqual(supertask.status, consts.TASK_STATUSES.pending)

        deploy_task = [t for t in supertask.subtasks
                       if t.name in (consts.TASK_NAMES.deployment)][0]

        NailgunReceiver.deploy_resp(
            task_uuid=deploy_task.uuid,
            status=consts.TASK_STATUSES.running,
            progress=50,
        )

        stop_task = self.env.stop_deployment()
        NailgunReceiver.stop_deployment_resp(
            task_uuid=stop_task.uuid,
            status=consts.TASK_STATUSES.ready,
            progress=100,
            nodes=[{'uid': n.uid} for n in self.env.nodes],
        )
        self.assertEqual(stop_task.status, consts.TASK_STATUSES.ready)

        self.assertTrue(self.db().query(Task).filter_by(
            uuid=deploy_task.uuid
        ).first())
        self.assertIsNone(objects.Task.get_by_uuid(deploy_task.uuid))

        self.assertEqual(self.cluster.status,
                         consts.CLUSTER_STATUSES.stopped)
        self.assertEqual(stop_task.progress, 100)
        self.assertFalse(self.cluster.is_locked)

        for n in self.cluster.nodes:
            self.assertEqual(n.roles, [])
            self.assertNotEqual(n.pending_roles, [])

        notification = self.db.query(Notification).filter_by(
            cluster_id=stop_task.cluster_id
        ).order_by(
            Notification.datetime.desc()
        ).first()
        self.assertRegexpMatches(
            notification.message,
            'was successfully stopped')
开发者ID:huyupeng,项目名称:fuel-web,代码行数:46,代码来源:test_stop_deployment.py


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