本文整理汇总了Python中nailgun.task.task.CheckBeforeDeploymentTask类的典型用法代码示例。如果您正苦于以下问题:Python CheckBeforeDeploymentTask类的具体用法?Python CheckBeforeDeploymentTask怎么用?Python CheckBeforeDeploymentTask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CheckBeforeDeploymentTask类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_ext_mongo_without_mongo_node
def test_ext_mongo_without_mongo_node(self):
cluster = self.env.create(
release_kwargs={
'attributes_metadata': self.get_custom_meta(True, True)},
nodes_kwargs=[]
)
task = Task(name=TASK_NAMES.deploy, cluster=cluster)
CheckBeforeDeploymentTask._check_mongo_nodes(task)
示例2: test_mongo_node_without_ext_mongo
def test_mongo_node_without_ext_mongo(self):
cluster = self.env.create(
release_kwargs={
'attributes_metadata': self.get_custom_meta(True, False)},
nodes_kwargs=[
{'pending_roles': ['mongo'],
'status': 'discover',
'pending_addition': True}
]
)
task = Task(name=TASK_NAMES.deploy, cluster=cluster)
CheckBeforeDeploymentTask._check_mongo_nodes(task)
示例3: test_check_volumes_and_disks_do_not_run_if_node_ready
def test_check_volumes_and_disks_do_not_run_if_node_ready(self):
self.set_node_status('ready')
with patch.object(
VolumeManager,
'check_disk_space_for_deployment') as check_mock:
CheckBeforeDeploymentTask._check_disks(self.task)
self.assertFalse(check_mock.called)
with patch.object(
VolumeManager,
'check_volume_sizes_for_deployment') as check_mock:
CheckBeforeDeploymentTask._check_volumes(self.task)
self.assertFalse(check_mock.called)
示例4: test_check_volumes_and_disks_run_if_node_not_ready
def test_check_volumes_and_disks_run_if_node_not_ready(self):
self.set_node_status('discover')
with patch.object(
VolumeManager,
'check_disk_space_for_deployment') as check_mock:
CheckBeforeDeploymentTask._check_disks(self.task)
self.assertEqual(check_mock.call_count, 1)
with patch.object(
VolumeManager,
'check_volume_sizes_for_deployment') as check_mock:
CheckBeforeDeploymentTask._check_volumes(self.task)
self.assertEqual(check_mock.call_count, 1)
示例5: test_check_nodes_online_do_not_raise_exception_node_to_deletion
def test_check_nodes_online_do_not_raise_exception_node_to_deletion(self):
self.node.online = False
self.node.pending_deletion = True
self.env.db.commit()
CheckBeforeDeploymentTask._check_nodes_are_online(self.task)
示例6: is_checking_required
def is_checking_required(self):
return CheckBeforeDeploymentTask._is_disk_checking_required(self.node)