servicebyservice.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:kostyor 作者: Mirantis 项目源码 文件源码
def start(self):
        subtasks = [self.driver.pre_upgrade()]

        for project in SCENARIO:
            for service in project.services:
                service, hosts = dbapi.get_service_with_hosts(
                    service.name,
                    self._upgrade['cluster_id'])

                # SCENARIO may contain services that are not deployed in
                # current setup. Hence, attempt to return its instance
                # and hosts will return None, and we have no choice but
                # ignore it and continue.
                if service:
                    subtasks.append(self.driver.start(service, hosts))

        # Execute gathered tasks one-by-one preserving order. Please note,
        # that it doesn't mean there can't be parallel execution since driver
        # may return a Celery group of tasks instead, and in that case the
        # group will be executed instead. The idea is to run one-by-one what
        # was returned by driver regardless whether it's a task, a group or
        # a chain.
        supertask = celery.chain(*subtasks)
        supertask.apply_async()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号