jenkins.py 文件源码

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

项目:ave 作者: sonyxperiadev 项目源码 文件源码
def handle_urllib2_error(url, e):
    if e.errno == errno.EINPROGRESS or '[Errno 115]' in str(e):
        raise Exception(
            'could not access: %s: operation timed out before completion '
            '(raise the timeout value?)' % url
        )
    elif isinstance(e, HTTPError):
        if e.getcode() == 403:
            raise Exception(
                "Host '%s' \n"
                "requires authentication, please add to jenkins.json\n"
                "format example:\n"
                "'auth' : {\n"
                "\t 'http://hostname' : {\n"
                "\t\t'method' : 'basic',\n"
                "\t\t'user' : 'username',\n"
                "\t\t'password' : 'pass'},\n"
                "\t 'http://hostname2...' : {'method' : None}\n"
                "}"
                % e.geturl()
            )
        elif e.getcode() == 401:
            raise Exception(
                "Invalid authentication to '%s', please update jenkins.json.\n"
                "Note that this will happen with invalid credentials "
                "even if the host doesn't require authentication for access."
                % e.geturl()
            )
    raise Exception('could not access %s: %s' % (url, e))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号