maas.py 文件源码

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

项目:charm-hacluster 作者: openstack 项目源码 文件源码
def install_maas_cli(self):
        """Ensure maas-cli is installed

        Fallback to MAAS stable PPA when needed.
        """
        apt.init()
        cache = apt.Cache()

        try:
            pkg = cache['maas-cli']
        except KeyError:
            cmd = ['add-apt-repository', '-y', MAAS_STABLE_PPA]
            subprocess.check_call(cmd)
            cmd = ['apt-get', 'update']
            subprocess.check_call(cmd)
            self.install_maas_cli()
            return

        if not pkg.current_ver:
            apt_install('maas-cli', fatal=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号