build.py 文件源码

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

项目:kolla 作者: sieve-microservices 项目源码 文件源码
def save_dependency(self, to_file):
        try:
            import graphviz
        except ImportError:
            LOG.error('"graphviz" is required for save dependency')
            raise
        dot = graphviz.Digraph(comment='Docker Images Dependency')
        dot.body.extend(['rankdir=LR'])
        for image in self.images:
            if image.status not in [STATUS_MATCHED]:
                continue
            dot.node(image.name)
            if image.parent is not None:
                dot.edge(image.parent.name, image.name)

        with open(to_file, 'w') as f:
            f.write(dot.source)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号