cvp_client.py 文件源码

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

项目:cvprac 作者: aristanetworks 项目源码 文件源码
def _reset_session(self):
        ''' Get a new request session and try logging into the current
            CVP node. If the login succeeded None will be returned and
            self.session will be valid. If the login failed then an
            exception error will be returned and self.session will
            be set to None.
        '''
        self.session = requests.Session()
        error = None
        try:
            self._login()
        except (ConnectionError, CvpApiError, CvpRequestError,
                CvpSessionLogOutError, HTTPError, ReadTimeout, Timeout,
                TooManyRedirects) as error:
            self.log.error(error)
            # Any error that occurs during login is a good reason not to use
            # this CVP node.
            self.session = None
        return error
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号