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


Python Environment.execute_tasks方法代码示例

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


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

示例1: execute_tasks

# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import execute_tasks [as 别名]
    def execute_tasks(self, params):
        """Execute deployment tasks
                fuel node --node 2 --tasks hiera netconfig
                fuel node --node 2 --skip hiera netconfig
                fuel node --node 2 --skip rsync --end pre_deployment
                fuel node --node 2 --end netconfig
                fuel node --node 2 --start hiera --end neutron
                fuel node --node 2 --start post_deployment
        """
        node_collection = NodeCollection.init_with_ids(params.node)
        env_id_to_start = self.get_env_id(node_collection)

        env = Environment(env_id_to_start)

        if params.tasks:
            tasks = params.tasks
        else:
            tasks = env.get_tasks(
                skip=params.skip, end=params.end, start=params.start)

        task = env.execute_tasks(node_collection.collection, tasks=tasks)

        self.serializer.print_to_output(
            task.data,
            "Started tasks {0} for nodes {1}.".format(tasks, node_collection))
开发者ID:kendriu,项目名称:python-fuelclient,代码行数:27,代码来源:node.py

示例2: execute_tasks

# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import execute_tasks [as 别名]
    def execute_tasks(self, params):
        """Execute deployment tasks
                fuel node --node 2 --tasks hiera netconfig
                fuel node --node 2 --tasks netconfig --force
                fuel node --node 2 --skip hiera netconfig
                fuel node --node 2 --skip rsync --end pre_deployment_end
                fuel node --node 2 --end netconfig
                fuel node --node 2 --start hiera --end neutron
                fuel node --node 2 --start post_deployment_start
        """
        node_collection = NodeCollection.init_with_ids(params.node)
        env_id_to_start = self.get_env_id(node_collection)

        env = Environment(env_id_to_start)

        tasks = params.tasks or None
        force = params.force or None

        if params.skip or params.end or params.start:
            tasks = env.get_tasks(
                skip=params.skip,
                end=params.end,
                start=params.start,
                include=tasks)

        if not tasks:
            self.serializer.print_to_output({}, "Nothing to run.")
            return

        task = env.execute_tasks(
            node_collection.collection, tasks=tasks, force=force)

        self.serializer.print_to_output(
            task.data,
            "Started tasks {0} for nodes {1}.".format(tasks, node_collection))
开发者ID:heartpandora,项目名称:python-fuelclient,代码行数:37,代码来源:node.py


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