# Path: muranoclient/common/exceptions.py
# class BaseException(Exception):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class ClientException(Exception):
# class HTTPException(ClientException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class SSLConfigurationError(BaseException):
# class SSLCertificateError(BaseException):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, details=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response):
# def from_code(code):


import copy
import hashlib
import os
import socket
import keystoneclient.adapter as keystone_adapter
import requests
import urllib
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
from muranoclient.common import exceptions as exc
            kwargs['cert'] = (self.cert_file, self.key_file)

        if self.verify_cert is not None:
            kwargs['verify'] = self.verify_cert

        if self.timeout is not None:
            kwargs['timeout'] = float(self.timeout)

        # Allow the option not to follow redirects
        follow_redirects = kwargs.pop('follow_redirects', True)

        # Since requests does not follow the RFC when doing redirection to sent
        # back the same method on a redirect we are simply bypassing it.  For
        # example if we do a DELETE/POST/PUT on a URL and we get a 302 RFC says
        # that we should follow that URL with the same method as before,
        # requests doesn't follow that and send a GET instead for the method.
        # Hopefully this could be fixed as they say in a comment in a future
        # point version i.e.: 3.x
        # See issue: https://github.com/kennethreitz/requests/issues/1704
        allow_redirects = False

        try:
            resp = requests.request(
                method,
                self.endpoint_url + url,
                allow_redirects=allow_redirects,
                **kwargs)
        except socket.gaierror as e:
            message = ("Error finding address for %(url)s: %(e)s" %
                       {'url': self.endpoint_url + url, 'e': e})

# Path: muranoclient/common/exceptions.py
# class BaseException(Exception):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class ClientException(Exception):
# class HTTPException(ClientException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class SSLConfigurationError(BaseException):
# class SSLCertificateError(BaseException):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, details=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response):
# def from_code(code):


# Path: muranoclient/common/http.py
import copy
import hashlib
import os
import socket
import keystoneclient.adapter as keystone_adapter
import requests
import urllib
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
from muranoclient.common import exceptions as exc

            kwargs['cert'] = (self.cert_file, self.key_file)

        if self.verify_cert is not None:
            kwargs['verify'] = self.verify_cert

        if self.timeout is not None:
            kwargs['timeout'] = float(self.timeout)

        # Allow the option not to follow redirects
        follow_redirects = kwargs.pop('follow_redirects', True)

        # Since requests does not follow the RFC when doing redirection to sent
        # back the same method on a redirect we are simply bypassing it.  For
        # example if we do a DELETE/POST/PUT on a URL and we get a 302 RFC says
        # that we should follow that URL with the same method as before,
        # requests doesn't follow that and send a GET instead for the method.
        # Hopefully this could be fixed as they say in a comment in a future
        # point version i.e.: 3.x
        # See issue: https://github.com/kennethreitz/requests/issues/1704
        allow_redirects = False

        try:
            resp = requests.request(
                method,
                self.endpoint_url + url,
                allow_redirects=allow_redirects,
                **kwargs)
        except socket.gaierror as e:
            message = ("Error finding address for %(url)s: %(e)s" %
                       {'url': self.endpoint_url + url, 'e': e})

            raise exc.InvalidEndpoint(message=message)