(self, url, params=None)
return jresp
Generic request handler for OpenStack API requests
        Raises specialized Exceptions for commonly encountered error codes
Generic request handler for OpenStack API requests
        Raises specialized Exceptions for commonly encountered error codes
Generic request handler for OpenStack API requests Raises specialized Exceptions for commonly encountered error codes
def _make_request(self, url, params=None):
        """
        Generic request handler for OpenStack API requests
        Raises specialized Exceptions for commonly encountered error codes
        """
        self.logger.debug("Request URL, Headers and Params: %s, %s, %s", url, self.http.options['headers'], params)

        try:
            resp = self.http.get(url, params=params)
            resp.raise_for_status()
        except requests.exceptions.HTTPError as e:
            self.logger.debug("Error contacting openstack endpoint: %s", e)
            if resp.status_code == 401:
                self.logger.info('Need to reauthenticate before next check')
                raise AuthenticationNeeded()
            elif resp.status_code == 409:
                raise InstancePowerOffFailure()
            else:
                raise e
        except Exception:
            self.logger.exception("Unexpected error contacting openstack endpoint %s", url)
            raise
        jresp = resp.json()
        self.logger.debug("url: %s || response: %s", url, jresp)

        return jresp
def _make_request ( self , url , params = None ) : self . logger . debug ( "Request URL, Headers and Params: %s, %s, %s" , url , self . http . options [ 'headers' ] , params ) try : resp = self . http . get ( url , params = params ) resp . raise_for_status ( ) except requests . exceptions . HTTPError as e : self . logger . debug ( "Error contacting openstack endpoint: %s" , e ) if resp . status_code == 401 : self . logger . info ( 'Need to reauthenticate before next check' ) raise AuthenticationNeeded ( ) elif resp . status_code == 409 : raise InstancePowerOffFailure ( ) else : raise e except Exception : self . logger . exception ( "Unexpected error contacting openstack endpoint %s" , url ) raise jresp = resp . json ( ) self . logger . debug ( "url: %s || response: %s" , url , jresp ) return jresp