nodebynode.py 文件源码

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

项目:kostyor 作者: Mirantis 项目源码 文件源码
def start(self):
        subtasks = [self.driver.pre_upgrade()]
        hosts = dbapi.get_hosts_by_cluster(self._upgrade['cluster_id'])

        # We may have plenty controllers each with various set of services.
        # In order to orchestrate upgrades properly, we need to iterate
        # by them in right order. For example, first goes controllers with
        # keystone, then with nova, and so on. See iteration details in
        # get_controllers() docstring.
        for host in iterhosts(hosts):
            for service in iterservices(host):
                subtasks.append(self.driver.start(service, [host]))

        # 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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号