local.py 文件源码

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

项目:pib 作者: datawire 项目源码 文件源码
def ensure_requirements(self):
        """Make sure kubectl and minikube are available."""
        uname = run_result("uname").lower()
        for path, url in zip([MINIKUBE, KUBECTL], [
                "https://storage.googleapis.com/minikube/releases/"
                "v0.15.0/minikube-{}-amd64",
                "https://storage.googleapis.com/kubernetes-release/"
                "release/v1.5.1/bin/{}/amd64/kubectl"
        ]):
            if path.exists() and not os.access(str(path), os.X_OK):
                # Apparently failed halfway through previous download
                os.remove(str(path))
            if not path.exists():
                self.echo("Downloading {}...".format(path.name))
                check_call([
                    "curl", "--create-dirs", "--silent", "--output", str(path),
                    url.format(uname)
                ])
                path.chmod(0o755)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号