本文整理汇总了Python中nailgun.rpc.receiver.NailgunReceiver.transaction_resp方法的典型用法代码示例。如果您正苦于以下问题:Python NailgunReceiver.transaction_resp方法的具体用法?Python NailgunReceiver.transaction_resp怎么用?Python NailgunReceiver.transaction_resp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nailgun.rpc.receiver.NailgunReceiver
的用法示例。
在下文中一共展示了NailgunReceiver.transaction_resp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_transaction_resp_update_transaction_status
# 需要导入模块: from nailgun.rpc.receiver import NailgunReceiver [as 别名]
# 或者: from nailgun.rpc.receiver.NailgunReceiver import transaction_resp [as 别名]
def test_transaction_resp_update_transaction_status(self, _):
task = self.env.create_task(
name=consts.TASK_NAMES.deployment,
status=consts.TASK_STATUSES.running,
cluster_id=self.cluster.id
)
NailgunReceiver.transaction_resp(
task_uuid=task.uuid,
status=consts.TASK_STATUSES.ready
)
self.db.refresh(task)
self.assertEqual(consts.TASK_STATUSES.ready, task.status)
示例2: test_transaction_resp_update_node_attributes
# 需要导入模块: from nailgun.rpc.receiver import NailgunReceiver [as 别名]
# 或者: from nailgun.rpc.receiver.NailgunReceiver import transaction_resp [as 别名]
def test_transaction_resp_update_node_attributes(self):
task = self.env.create_task(
name=consts.TASK_NAMES.deployment,
status=consts.TASK_STATUSES.running,
cluster_id=self.cluster.id
)
node = self.cluster.nodes[0]
node.status = consts.NODE_STATUSES.provisioned
node.progress = 1
node.pending_addition = True
NailgunReceiver.transaction_resp(
task_uuid=task.uuid,
nodes=[{
'uid': node.uid, 'progress': 50, 'pending_addition': False
}]
)
self.db.refresh(node)
self.assertEqual(50, node.progress)
self.assertFalse(node.pending_addition)
示例3: test_transaction_resp_does_not_fail_on_virtual_nodes
# 需要导入模块: from nailgun.rpc.receiver import NailgunReceiver [as 别名]
# 或者: from nailgun.rpc.receiver.NailgunReceiver import transaction_resp [as 别名]
def test_transaction_resp_does_not_fail_on_virtual_nodes(self):
task = self.env.create_task(
name=consts.TASK_NAMES.deployment,
status=consts.TASK_STATUSES.running,
cluster_id=self.cluster.id,
dry_run=True
)
NailgunReceiver.transaction_resp(
task_uuid=task.uuid,
status=consts.TASK_STATUSES.running,
nodes=[
{
'uid': consts.MASTER_NODE_UID,
'status': consts.NODE_STATUSES.provisioned,
},
{
# cluster node uid is null
'uid': None,
'status': consts.NODE_STATUSES.provisioned,
},
])
示例4: test_transaction_resp_does_not_update_nodes_if_dry_run
# 需要导入模块: from nailgun.rpc.receiver import NailgunReceiver [as 别名]
# 或者: from nailgun.rpc.receiver.NailgunReceiver import transaction_resp [as 别名]
def test_transaction_resp_does_not_update_nodes_if_dry_run(self, _):
task = self.env.create_task(
name=consts.TASK_NAMES.deployment,
status=consts.TASK_STATUSES.running,
cluster_id=self.cluster.id,
dry_run=True
)
self.cluster.status = consts.CLUSTER_STATUSES.operational
node = self.cluster.nodes[0]
node.status = consts.NODE_STATUSES.provisioned
NailgunReceiver.transaction_resp(
task_uuid=task.uuid,
status=consts.TASK_STATUSES.ready,
nodes=[{'uid': node.uid, 'status': consts.NODE_STATUSES.ready}]
)
self.db.refresh(task)
self.db.refresh(node)
self.db.refresh(self.cluster)
self.assertEqual(consts.TASK_STATUSES.ready, task.status)
self.assertEqual(consts.NODE_STATUSES.provisioned, node.status)
self.assertEqual(
consts.CLUSTER_STATUSES.operational, self.cluster.status
)