# 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):


import logging
from openstack import config
from oslo_utils import importutils
from ironicclient.common.i18n import _
from ironicclient import exc
        # TODO(dtantsur): consider flipping load_yaml_config to True to support
        # the clouds.yaml format.
        region = config.get_cloud_region(load_yaml_config=False,
                                         load_envvars=False,
                                         auth_type=auth_type,
                                         **kwargs)
        session = region.get_session()

    # Make sure we also pass the endpoint interface to the HTTP client.
    # NOTE(gyee/efried): 'interface' in ksa config is deprecated in favor of
    # 'valid_interfaces'. So, since the caller may be deriving kwargs from
    # conf, accept 'valid_interfaces' first. But keep support for 'interface',
    # in case the caller is deriving kwargs from, say, an existing Adapter.
    interface = valid_interfaces or interface

    endpoint = kwargs.get('endpoint')
    if not endpoint:
        try:
            # endpoint will be used to get hostname
            # and port that will be used for API version caching.
            # NOTE(gyee): KSA defaults interface to 'public' if it is
            # empty or None so there's no need to set it to publicURL
            # explicitly.
            endpoint = session.get_endpoint(
                service_type=service_type or 'baremetal',
                interface=interface,
                region_name=region_name,
            )
        except Exception as e:
            raise exc.AmbiguousAuthSystem(

# 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/client.py
import logging
from openstack import config
from oslo_utils import importutils
from ironicclient.common.i18n import _
from ironicclient import exc

        # TODO(dtantsur): consider flipping load_yaml_config to True to support
        # the clouds.yaml format.
        region = config.get_cloud_region(load_yaml_config=False,
                                         load_envvars=False,
                                         auth_type=auth_type,
                                         **kwargs)
        session = region.get_session()

    # Make sure we also pass the endpoint interface to the HTTP client.
    # NOTE(gyee/efried): 'interface' in ksa config is deprecated in favor of
    # 'valid_interfaces'. So, since the caller may be deriving kwargs from
    # conf, accept 'valid_interfaces' first. But keep support for 'interface',
    # in case the caller is deriving kwargs from, say, an existing Adapter.
    interface = valid_interfaces or interface

    endpoint = kwargs.get('endpoint')
    if not endpoint:
        try:
            # endpoint will be used to get hostname
            # and port that will be used for API version caching.
            # NOTE(gyee): KSA defaults interface to 'public' if it is
            # empty or None so there's no need to set it to publicURL
            # explicitly.
            endpoint = session.get_endpoint(
                service_type=service_type or 'baremetal',
                interface=interface,
                region_name=region_name,
            )
        except Exception as e:
            raise exc.AmbiguousAuthSystem(

                _('Must provide Keystone credentials or user-defined '