本文整理汇总了Python中nailgun.task.helpers.TaskHelper.get_nodes_to_deployment_error方法的典型用法代码示例。如果您正苦于以下问题:Python TaskHelper.get_nodes_to_deployment_error方法的具体用法?Python TaskHelper.get_nodes_to_deployment_error怎么用?Python TaskHelper.get_nodes_to_deployment_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nailgun.task.helpers.TaskHelper
的用法示例。
在下文中一共展示了TaskHelper.get_nodes_to_deployment_error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _update_cluster_data
# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import get_nodes_to_deployment_error [as 别名]
def _update_cluster_data(cls, instance):
cluster = instance.cluster
if instance.name == "deploy":
if instance.status == "ready":
# If for some reasosns orchestrator
# didn't send ready status for node
# we should set it explicitly
for n in cluster.nodes:
if n.status == "deploying":
n.status = "ready"
n.progress = 100
cls.__update_cluster_status(cluster, "operational")
Cluster.clear_pending_changes(cluster)
elif instance.status == "error" and not TaskHelper.before_deployment_error(instance):
# We don't want to set cluster status to
# error because we don't want to lock
# settings if cluster wasn't delpoyed
cls.__update_cluster_status(cluster, "error")
elif instance.name == "deployment" and instance.status == "error":
cls.__update_cluster_status(cluster, "error")
q_nodes_to_error = TaskHelper.get_nodes_to_deployment_error(cluster)
cls.__update_nodes_to_error(q_nodes_to_error, error_type="deploy")
elif instance.name == "provision" and instance.status == "error":
cls.__update_cluster_status(cluster, "error")
q_nodes_to_error = TaskHelper.get_nodes_to_provisioning_error(cluster)
cls.__update_nodes_to_error(q_nodes_to_error, error_type="provision")
elif instance.name == "stop_deployment":
if instance.status == "error":
cls.__update_cluster_status(cluster, "error")
else:
cls.__update_cluster_status(cluster, "stopped")
elif instance.name == consts.TASK_NAMES.update:
if instance.status == consts.TASK_STATUSES.error:
cls.__update_cluster_status(cluster, consts.CLUSTER_STATUSES.update_error)
q_nodes_to_error = TaskHelper.get_nodes_to_deployment_error(cluster)
cls.__update_nodes_to_error(q_nodes_to_error, error_type=consts.NODE_ERRORS.deploy)
elif instance.status == consts.TASK_STATUSES.ready:
cls.__update_cluster_status(cluster, consts.CLUSTER_STATUSES.operational)
cluster.release_id = cluster.pending_release_id
cluster.pending_release_id = None
示例2: _update_cluster_data
# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import get_nodes_to_deployment_error [as 别名]
def _update_cluster_data(cls, instance):
cluster = instance.cluster
if instance.name == 'deploy':
if instance.status == 'ready':
# If for some reasosns orchestrator
# didn't send ready status for node
# we should set it explicitly
for n in cluster.nodes:
if n.status == 'deploying':
n.status = 'ready'
n.progress = 100
cls.__update_cluster_status(cluster, 'operational')
Cluster.clear_pending_changes(cluster)
elif instance.status == 'error' and \
not TaskHelper.before_deployment_error(instance):
# We don't want to set cluster status to
# error because we don't want to lock
# settings if cluster wasn't delpoyed
cls.__update_cluster_status(cluster, 'error')
elif instance.name == consts.TASK_NAMES.spawn_vms:
if instance.status == consts.TASK_STATUSES.ready:
Cluster.mark_vms_as_created(cluster)
elif instance.status == consts.TASK_STATUSES.error and \
not TaskHelper.before_deployment_error(instance):
cls.__update_cluster_status(cluster, 'error')
elif instance.name == 'deployment' and instance.status == 'error':
cls.__update_cluster_status(cluster, 'error')
q_nodes_to_error = \
TaskHelper.get_nodes_to_deployment_error(cluster)
cls.__update_nodes_to_error(q_nodes_to_error,
error_type='deploy')
elif instance.name == 'provision' and instance.status == 'error':
cls.__update_cluster_status(cluster, 'error')
q_nodes_to_error = \
TaskHelper.get_nodes_to_provisioning_error(cluster)
cls.__update_nodes_to_error(q_nodes_to_error,
error_type='provision')
elif instance.name == 'stop_deployment':
if instance.status == 'error':
cls.__update_cluster_status(cluster, 'error')
else:
cls.__update_cluster_status(cluster, 'stopped')
elif instance.name == consts.TASK_NAMES.update:
if instance.status == consts.TASK_STATUSES.error:
cls.__update_cluster_status(
cluster,
consts.CLUSTER_STATUSES.update_error
)
q_nodes_to_error = \
TaskHelper.get_nodes_to_deployment_error(cluster)
cls.__update_nodes_to_error(
q_nodes_to_error, error_type=consts.NODE_ERRORS.deploy)
elif instance.status == consts.TASK_STATUSES.ready:
cls.__update_cluster_status(
cluster,
consts.CLUSTER_STATUSES.operational
)
cluster.release_id = cluster.pending_release_id
cluster.pending_release_id = None
示例3: _update_cluster_data
# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import get_nodes_to_deployment_error [as 别名]
def _update_cluster_data(cls, instance):
cluster = instance.cluster
if instance.name == consts.TASK_NAMES.deployment:
if instance.status == consts.TASK_STATUSES.ready:
# If for some reasons orchestrator
# didn't send ready status for node
# we should set it explicitly
for n in cluster.nodes:
if n.status == consts.NODE_STATUSES.deploying:
n.status = consts.NODE_STATUSES.ready
n.progress = 100
cls.__update_cluster_status(
cluster,
consts.CLUSTER_STATUSES.operational,
consts.NODE_STATUSES.ready
)
Cluster.clear_pending_changes(cluster)
elif instance.status == consts.CLUSTER_STATUSES.error:
cls.__update_cluster_status(
cluster, consts.CLUSTER_STATUSES.error, None
)
q_nodes_to_error = TaskHelper.get_nodes_to_deployment_error(
cluster
)
cls.__update_nodes_to_error(
q_nodes_to_error, error_type=consts.NODE_ERRORS.deploy
)
elif instance.name == consts.TASK_NAMES.spawn_vms:
if instance.status == consts.TASK_STATUSES.ready:
Cluster.set_vms_created_state(cluster)
elif (instance.status == consts.TASK_STATUSES.error and
not TaskHelper.before_deployment_error(instance)):
cls.__update_cluster_status(
cluster, consts.CLUSTER_STATUSES.error, None
)
elif instance.name == consts.TASK_NAMES.deploy and \
instance.status == consts.TASK_STATUSES.error and \
not TaskHelper.before_deployment_error(instance):
# We don't want to set cluster status to
# error because we don't want to lock
# settings if cluster wasn't deployed
cls.__update_cluster_status(
cluster, consts.CLUSTER_STATUSES.error, None
)
elif instance.name == consts.TASK_NAMES.provision:
if instance.status == consts.TASK_STATUSES.ready:
cls.__update_cluster_status(
cluster, consts.CLUSTER_STATUSES.partially_deployed, None
)
elif instance.status == consts.TASK_STATUSES.error:
cls.__update_cluster_status(
cluster, consts.CLUSTER_STATUSES.error, None
)
q_nodes_to_error = \
TaskHelper.get_nodes_to_provisioning_error(cluster)
cls.__update_nodes_to_error(
q_nodes_to_error, error_type=consts.NODE_ERRORS.provision)
elif instance.name == consts.TASK_NAMES.stop_deployment:
if instance.status == consts.TASK_STATUSES.error:
cls.__update_cluster_status(
cluster, consts.CLUSTER_STATUSES.error, None
)
else:
cls.__update_cluster_status(
cluster, consts.CLUSTER_STATUSES.stopped, None
)