ndio/remote/remote_utils.py
def get_url(self, url):
        """
        Get a response object for a given url.

        Arguments:
            url (str): The url make a get to
            token (str): The authentication token

        Returns:
            obj: The response object
        """
        try:
            req = requests.get(url, headers={
                'Authorization': 'Token {}'.format(self._user_token)
            }, verify=False)
            if req.status_code is 403:
                raise ValueError("Access Denied")
            else:
                return req
        except requests.exceptions.ConnectionError as e:
            if str(e) == '403 Client Error: Forbidden':
                raise ValueError('Access Denied')
            else:
                raise e
def get_url(self, url):
        """
        Get a response object for a given url.

        Arguments:
            url (str): The url make a get to
            token (str): The authentication token

        Returns:
            obj: The response object
        """
        try:
            req = requests.get(url, headers={
                'Authorization': 'Token {}'.format(self._user_token)
            }, verify=False)
            if req.status_code is 403:
                raise ValueError("Access Denied")
            else:
                return req
        except requests.exceptions.ConnectionError as e:
            if str(e) == '403 Client Error: Forbidden':
                raise ValueError('Access Denied')
            else:
                raise e
Get a response object for a given url.

        Arguments:
            url (str): The url make a get to
            token (str): The authentication token

        Returns:
            obj: The response object