functest_utils.py 文件源码

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

项目:functest 作者: opnfv 项目源码 文件源码
def download_url(url, dest_path):
    """
    Download a file to a destination path given a URL
    """
    name = url.rsplit('/')[-1]
    dest = dest_path + "/" + name
    try:
        response = urllib.request.urlopen(url)
    except (urllib.error.HTTPError, urllib.error.URLError):
        return False

    with open(dest, 'wb') as f:
        shutil.copyfileobj(response, f)
    return True


# ----------------------------------------------------------
#
#               CI UTILS
#
# -----------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号