示例#1
0
文件: stages.py 项目: mba811/fuel-web
def stage_serialize(serializer, graph_tasks, cluster, nodes):
    """Serialize tasks for given stage

    :param serialize: orchestrator.plugins.BasePluginDeploymentHooksSerializer
    :param graph_tasks: list of tasks
    :param cluster: cluster db object
    :param nodes: list of node db objects
    """
    priority = PriorityStrategy()
    tasks = []

    tasks.extend(graph_tasks)

    plugins = serializer(cluster, nodes)
    tasks.extend(plugins.serialize())
    priority.one_by_one(tasks)

    return tasks
示例#2
0
def stage_serialize(serializer, graph_tasks, cluster, nodes):
    """Serialize tasks for given stage

    :param serialize: orchestrator.plugins.BasePluginDeploymentHooksSerializer
    :param graph_tasks: list of tasks
    :param cluster: cluster db object
    :param nodes: list of node db objects
    """
    priority = PriorityStrategy()
    tasks = []

    tasks.extend(graph_tasks)

    plugins = serializer(cluster, nodes)
    tasks.extend(plugins.serialize())
    priority.one_by_one(tasks)

    return tasks
示例#3
0
def stage_serialize(serializer, graph_tasks):
    """Serialize tasks for given stage

    :param serializer: plugins_serializers.BasePluginDeploymentHooksSerializer
    :param graph_tasks: list of tasks
    """

    tasks = list(
        itertools.chain(serializer.serialize_begin_tasks(), graph_tasks,
                        serializer.serialize_end_tasks()))
    PriorityStrategy().one_by_one(tasks)
    return tasks
    def serialize_pre_provision_tasks(cls, cluster):
        tasks = super(ProvisioningSerializer80,
                      cls).serialize_pre_provision_tasks(cluster)

        attrs = objects.Attributes.merged_attrs_values(cluster.attributes)

        if attrs['ironic']['enabled']:
            tasks.append(
                tasks_templates.generate_ironic_bootstrap_keys_task(
                    [consts.MASTER_NODE_UID], cluster.id))

            tasks.append(
                tasks_templates.make_ironic_bootstrap_task(
                    [consts.MASTER_NODE_UID], cluster.id))

        PriorityStrategy().one_by_one(tasks)
        return tasks
示例#5
0
    def serialize_pre_provision_tasks(cls, cluster):
        tasks = []
        attrs = objects.Attributes.merged_attrs_values(cluster.attributes)

        is_build_images = all([
            cluster.release.operating_system == consts.RELEASE_OS.ubuntu,
            attrs['provision']['method'] == consts.PROVISION_METHODS.image
        ])

        if is_build_images:
            packages = cls._make_provisioning_package_list(attrs['provision'])
            tasks.append(
                tasks_templates.make_provisioning_images_task(
                    [consts.MASTER_NODE_UID], attrs['repo_setup']['repos'],
                    attrs['provision'], cluster.id, packages))

        PriorityStrategy().one_by_one(tasks)
        return tasks
示例#6
0
 def __init__(self, cluster, nodes):
     self.cluster = cluster
     self.nodes = nodes
     self.priority = PriorityStrategy()