# Path: ironicclient/common/filecache.py
# LOG = logging.getLogger(__name__)
# AUTHOR = 'openstack'
# PROGNAME = 'python-ironicclient'
# CACHE = None
# CACHE_DIR = appdirs.user_cache_dir(PROGNAME, AUTHOR)
# CACHE_EXPIRY_ENV_VAR = 'IRONICCLIENT_CACHE_EXPIRY'  # environment variable
# CACHE_FILENAME = os.path.join(CACHE_DIR, 'ironic-api-version.dbm')
# DEFAULT_EXPIRY = 300  # seconds
#         CACHE = dogpile.cache.make_region(key_mangler=str).configure(
#             'dogpile.cache.dbm',
#             expiration_time=expiry_time,
#             arguments={
#                 "filename": CACHE_FILENAME,
#             }
#         )
# def _get_cache():
# def _build_key(host, port):
# def save_data(host, port, data):
# def retrieve_data(host, port, expiry=None):
# 
# Path: ironicclient/common/i18n.py
# def _(msg):
#     return msg
# 
# Path: ironicclient/exc.py
# class AmbiguousAuthSystem(exceptions.ClientException):
# class InvalidAttribute(exceptions.ClientException):
# class StateTransitionFailed(exceptions.ClientException):
# class StateTransitionTimeout(exceptions.ClientException):
# def from_response(response, message=None, traceback=None, method=None,
#                   url=None):


from distutils.version import StrictVersion
from http import client as http_client
from urllib import parse as urlparse
from keystoneauth1 import adapter
from keystoneauth1 import exceptions as kexc
from ironicclient.common import filecache
from ironicclient.common.i18n import _
from ironicclient import exc
import functools
import json
import logging
import re
import textwrap
import time
                    versions.append(StrictVersion(version))
            if versions:
                negotiated_ver = str(max(versions))
            else:
                raise exc.UnsupportedVersion(textwrap.fill(
                    _("Requested API version specified and the requested "
                      "operation was not supported by the client's "
                      "requested API version %(req)s.  Supported "
                      "version range is: %(min)s to %(max)s")
                    % {'req': requested_version,
                       'min': min_ver, 'max': max_ver}))

        else:
            raise ValueError(textwrap.fill(
                _("Requested API version %(req)s type is unsupported. "
                  "Valid types are Strings such as '1.1', 'latest' "
                  "or a list of string values representing API versions.")
                % {'req': requested_version}))

        if StrictVersion(negotiated_ver) < StrictVersion(min_ver):
            negotiated_ver = min_ver
        # server handles microversions, but doesn't support
        # the requested version, so try a negotiated version
        self.api_version_select_state = 'negotiated'
        self.os_ironic_api_version = negotiated_ver
        LOG.debug('Negotiated API version is %s', negotiated_ver)

        # Cache the negotiated version for this server
        endpoint_override = getattr(self, 'endpoint_override', None)
        host, port = get_server(endpoint_override)

# Path: ironicclient/common/filecache.py
# LOG = logging.getLogger(__name__)
# AUTHOR = 'openstack'
# PROGNAME = 'python-ironicclient'
# CACHE = None
# CACHE_DIR = appdirs.user_cache_dir(PROGNAME, AUTHOR)
# CACHE_EXPIRY_ENV_VAR = 'IRONICCLIENT_CACHE_EXPIRY'  # environment variable
# CACHE_FILENAME = os.path.join(CACHE_DIR, 'ironic-api-version.dbm')
# DEFAULT_EXPIRY = 300  # seconds
#         CACHE = dogpile.cache.make_region(key_mangler=str).configure(
#             'dogpile.cache.dbm',
#             expiration_time=expiry_time,
#             arguments={
#                 "filename": CACHE_FILENAME,
#             }
#         )
# def _get_cache():
# def _build_key(host, port):
# def save_data(host, port, data):
# def retrieve_data(host, port, expiry=None):
# 
# Path: ironicclient/common/i18n.py
# def _(msg):
#     return msg
# 
# Path: ironicclient/exc.py
# class AmbiguousAuthSystem(exceptions.ClientException):
# class InvalidAttribute(exceptions.ClientException):
# class StateTransitionFailed(exceptions.ClientException):
# class StateTransitionTimeout(exceptions.ClientException):
# def from_response(response, message=None, traceback=None, method=None,
#                   url=None):


# Path: ironicclient/common/http.py
from distutils.version import StrictVersion
from http import client as http_client
from urllib import parse as urlparse
from keystoneauth1 import adapter
from keystoneauth1 import exceptions as kexc
from ironicclient.common import filecache
from ironicclient.common.i18n import _
from ironicclient import exc
import functools
import json
import logging
import re
import textwrap
import time

                    versions.append(StrictVersion(version))
            if versions:
                negotiated_ver = str(max(versions))
            else:
                raise exc.UnsupportedVersion(textwrap.fill(
                    _("Requested API version specified and the requested "
                      "operation was not supported by the client's "
                      "requested API version %(req)s.  Supported "
                      "version range is: %(min)s to %(max)s")
                    % {'req': requested_version,
                       'min': min_ver, 'max': max_ver}))

        else:
            raise ValueError(textwrap.fill(
                _("Requested API version %(req)s type is unsupported. "
                  "Valid types are Strings such as '1.1', 'latest' "
                  "or a list of string values representing API versions.")
                % {'req': requested_version}))

        if StrictVersion(negotiated_ver) < StrictVersion(min_ver):
            negotiated_ver = min_ver
        # server handles microversions, but doesn't support
        # the requested version, so try a negotiated version
        self.api_version_select_state = 'negotiated'
        self.os_ironic_api_version = negotiated_ver
        LOG.debug('Negotiated API version is %s', negotiated_ver)

        # Cache the negotiated version for this server
        endpoint_override = getattr(self, 'endpoint_override', None)
        host, port = get_server(endpoint_override)

        filecache.save_data(host=host, port=port, data=negotiated_ver)