# Path: ironicclient/common/http.py
# DEFAULT_VER = '1.9'
# LAST_KNOWN_API_VERSION = 78
# LATEST_VERSION = '1.{}'.format(LAST_KNOWN_API_VERSION)
# LOG = logging.getLogger(__name__)
# USER_AGENT = 'python-ironicclient'
# CHUNKSIZE = 1024 * 64  # 64kB
# _MAJOR_VERSION = 1
# API_VERSION = '/v%d' % _MAJOR_VERSION
# API_VERSION_SELECTED_STATES = ('user', 'negotiated', 'cached', 'default')
# DEFAULT_MAX_RETRIES = 5
# DEFAULT_RETRY_INTERVAL = 2
# SENSITIVE_HEADERS = ('X-Auth-Token',)
# SUPPORTED_ENDPOINT_SCHEME = ('http', 'https')
# _API_VERSION_RE = re.compile(r'/+(v%d)?/*$' % _MAJOR_VERSION)
# _RETRY_EXCEPTIONS = (exc.Conflict, exc.ServiceUnavailable,
#                      exc.ConnectionRefused, kexc.RetriableConnectionFailure)
# def _trim_endpoint_api_version(url):
# def _extract_error_json(body):
# def get_server(url):
#     def negotiate_version(self, conn, resp):
#         def _query_server(conn):
#     def _generic_parse_version_headers(self, accessor_func):
#     def _parse_version_headers(self, accessor_func):
#     def _make_simple_request(self, conn, method, url):
#     def _must_negotiate_version(self):
# def with_retries(func):
#     def wrapper(self, url, method, **kwargs):
#     def __init__(self,
#                  os_ironic_api_version,
#                  api_version_select_state,
#                  max_retries,
#                  retry_interval,
#                  **kwargs):
#     def _parse_version_headers(self, resp):
#     def _get_endpoint_filter(self):
#     def _make_simple_request(self, conn, method, url):
#     def _http_request(self, url, method, **kwargs):
#     def json_request(self, method, url, **kwargs):
#     def raw_request(self, method, url, **kwargs):
# def _construct_http_client(session,
#                            token=None,
#                            auth_ref=None,
#                            os_ironic_api_version=DEFAULT_VER,
#                            api_version_select_state='default',
#                            max_retries=DEFAULT_MAX_RETRIES,
#                            retry_interval=DEFAULT_RETRY_INTERVAL,
#                            timeout=600,
#                            ca_file=None,
#                            cert_file=None,
#                            key_file=None,
#                            insecure=None,
#                            **kwargs):
# class VersionNegotiationMixin(object):
# class SessionClient(VersionNegotiationMixin, adapter.LegacyJsonAdapter):
# 
# 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/v1/client.py
# LOG = logging.getLogger(__name__)
# class Client(object):
#     def __init__(self, endpoint_override=None, *args, **kwargs):
#     def current_api_version(self):
#     def is_api_version_negotiated(self):
#     def negotiate_api_version(self):


import logging
import sys
    import ironic_inspector_client
import openstack
import pbr.version
from cliff import app
from cliff import commandmanager
from openstack import config as os_config
from osc_lib import utils
from ironicclient.common import http
from ironicclient.common.i18n import _
from ironicclient import exc
from ironicclient.v1 import client

LOG = logging.getLogger(__name__)


class ClientManager(object):

    def __init__(self, cloud_region, options):
        self.cloud_region = cloud_region
        self.options = options
        self._ironic = None
        self._inspector = None

    @property
    def baremetal(self):
        if self._ironic is None:
            self._ironic = self._create_ironic_client()
        return self._ironic

    @property
    def baremetal_introspection(self):
        if self._inspector is None:
            self._inspector = self._create_inspector_client()
        return self._inspector

    def _create_ironic_client(self):
        api_version = self.options.os_baremetal_api_version
        allow_api_version_downgrade = False
        if not api_version:
            api_version = self.cloud_region.get_default_microversion(_TYPE)
            if not api_version:

# Path: ironicclient/common/http.py
# DEFAULT_VER = '1.9'
# LAST_KNOWN_API_VERSION = 78
# LATEST_VERSION = '1.{}'.format(LAST_KNOWN_API_VERSION)
# LOG = logging.getLogger(__name__)
# USER_AGENT = 'python-ironicclient'
# CHUNKSIZE = 1024 * 64  # 64kB
# _MAJOR_VERSION = 1
# API_VERSION = '/v%d' % _MAJOR_VERSION
# API_VERSION_SELECTED_STATES = ('user', 'negotiated', 'cached', 'default')
# DEFAULT_MAX_RETRIES = 5
# DEFAULT_RETRY_INTERVAL = 2
# SENSITIVE_HEADERS = ('X-Auth-Token',)
# SUPPORTED_ENDPOINT_SCHEME = ('http', 'https')
# _API_VERSION_RE = re.compile(r'/+(v%d)?/*$' % _MAJOR_VERSION)
# _RETRY_EXCEPTIONS = (exc.Conflict, exc.ServiceUnavailable,
#                      exc.ConnectionRefused, kexc.RetriableConnectionFailure)
# def _trim_endpoint_api_version(url):
# def _extract_error_json(body):
# def get_server(url):
#     def negotiate_version(self, conn, resp):
#         def _query_server(conn):
#     def _generic_parse_version_headers(self, accessor_func):
#     def _parse_version_headers(self, accessor_func):
#     def _make_simple_request(self, conn, method, url):
#     def _must_negotiate_version(self):
# def with_retries(func):
#     def wrapper(self, url, method, **kwargs):
#     def __init__(self,
#                  os_ironic_api_version,
#                  api_version_select_state,
#                  max_retries,
#                  retry_interval,
#                  **kwargs):
#     def _parse_version_headers(self, resp):
#     def _get_endpoint_filter(self):
#     def _make_simple_request(self, conn, method, url):
#     def _http_request(self, url, method, **kwargs):
#     def json_request(self, method, url, **kwargs):
#     def raw_request(self, method, url, **kwargs):
# def _construct_http_client(session,
#                            token=None,
#                            auth_ref=None,
#                            os_ironic_api_version=DEFAULT_VER,
#                            api_version_select_state='default',
#                            max_retries=DEFAULT_MAX_RETRIES,
#                            retry_interval=DEFAULT_RETRY_INTERVAL,
#                            timeout=600,
#                            ca_file=None,
#                            cert_file=None,
#                            key_file=None,
#                            insecure=None,
#                            **kwargs):
# class VersionNegotiationMixin(object):
# class SessionClient(VersionNegotiationMixin, adapter.LegacyJsonAdapter):
# 
# 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/v1/client.py
# LOG = logging.getLogger(__name__)
# class Client(object):
#     def __init__(self, endpoint_override=None, *args, **kwargs):
#     def current_api_version(self):
#     def is_api_version_negotiated(self):
#     def negotiate_api_version(self):


# Path: ironicclient/shell.py
import logging
import sys
    import ironic_inspector_client
import openstack
import pbr.version
from cliff import app
from cliff import commandmanager
from openstack import config as os_config
from osc_lib import utils
from ironicclient.common import http
from ironicclient.common.i18n import _
from ironicclient import exc
from ironicclient.v1 import client


LOG = logging.getLogger(__name__)


class ClientManager(object):

    def __init__(self, cloud_region, options):
        self.cloud_region = cloud_region
        self.options = options
        self._ironic = None
        self._inspector = None

    @property
    def baremetal(self):
        if self._ironic is None:
            self._ironic = self._create_ironic_client()
        return self._ironic

    @property
    def baremetal_introspection(self):
        if self._inspector is None:
            self._inspector = self._create_inspector_client()
        return self._inspector

    def _create_ironic_client(self):
        api_version = self.options.os_baremetal_api_version
        allow_api_version_downgrade = False
        if not api_version:
            api_version = self.cloud_region.get_default_microversion(_TYPE)
            if not api_version:

                api_version = http.LATEST_VERSION