gerritstack.py 文件源码

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

项目:review-rot 作者: nirzari 项目源码 文件源码
def check_host_url(self, ssl_verify):
        """
        Check if host url is valid
        Args:
            ssl_verify (bool/str): Whether or not to verify SSL certificates,
                                   or a path to a CA file to use.
        Returns:
             true/false(bool): Returns true if url is valid else false
        """
        log.debug('Checking if host URL %s is correct', self.url)
        try:
            response = self.get_response(method='GET', url=self.url,
                                         ssl_verify=ssl_verify)
            if response.status_code == 200:
                return True
            else:
                raise ValueError('Host URL is incorrectly configured'
                                 ' in config file.')
        except (ValueError, requests.ConnectionError):
            raise ValueError('Host URL is incorrectly configured'
                             ' in config file.')
        except:
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号