# Path: muranoclient/apiclient/exceptions.py
# class ClientException(Exception):
# class MissingArgs(ClientException):
# class ValidationError(ClientException):
# class UnsupportedVersion(ClientException):
# class CommandError(ClientException):
# class AuthorizationFailure(ClientException):
# class ConnectionRefused(ClientException):
# class AuthPluginOptionsMissing(AuthorizationFailure):
# class AuthSystemNotFound(AuthorizationFailure):
# class NoUniqueMatch(ClientException):
# class EndpointException(ClientException):
# class EndpointNotFound(EndpointException):
# class AmbiguousEndpoints(EndpointException):
# class HttpError(ClientException):
# class HTTPRedirection(HttpError):
# class HTTPClientError(HttpError):
# class HttpServerError(HttpError):
# class MultipleChoices(HTTPRedirection):
# class BadRequest(HTTPClientError):
# class Unauthorized(HTTPClientError):
# class PaymentRequired(HTTPClientError):
# class Forbidden(HTTPClientError):
# class NotFound(HTTPClientError):
# class MethodNotAllowed(HTTPClientError):
# class NotAcceptable(HTTPClientError):
# class ProxyAuthenticationRequired(HTTPClientError):
# class RequestTimeout(HTTPClientError):
# class Conflict(HTTPClientError):
# class Gone(HTTPClientError):
# class LengthRequired(HTTPClientError):
# class PreconditionFailed(HTTPClientError):
# class RequestEntityTooLarge(HTTPClientError):
# class RequestUriTooLong(HTTPClientError):
# class UnsupportedMediaType(HTTPClientError):
# class RequestedRangeNotSatisfiable(HTTPClientError):
# class ExpectationFailed(HTTPClientError):
# class UnprocessableEntity(HTTPClientError):
# class InternalServerError(HttpServerError):
# class HttpNotImplemented(HttpServerError):
# class BadGateway(HttpServerError):
# class ServiceUnavailable(HttpServerError):
# class GatewayTimeout(HttpServerError):
# class HttpVersionNotSupported(HttpServerError):
#     def __init__(self, missing):
#     def __init__(self, opt_names):
#     def __init__(self, auth_system):
#     def __init__(self, endpoints=None):
#     def __init__(self, message=None, details=None,
#                  response=None, request_id=None,
#                  url=None, method=None, http_status=None):
#     def __init__(self, *args, **kwargs):
# def from_response(response, url, method):
# 
# Path: muranoclient/glance/client.py
# class Client(object):
#     def __init__(self, endpoint, type_name, type_version, **kwargs):
# 
# Path: muranoclient/i18n.py



from osc_lib import utils
from oslo_log import log as logging
from muranoclient.apiclient import exceptions as exc
from muranoclient.glance import client as art_client
from muranoclient.i18n import _
def make_client(instance):
    """Returns an application-catalog service client"""
    application_catalog_client = utils.get_client_class(
        API_NAME,
        instance._api_version[API_NAME],
        API_VERSIONS)
    LOG.debug("Instantiating application-catalog client: {0}".format(
              application_catalog_client))

    kwargs = {
        'session': instance.session,
        'service_type': 'application-catalog',
        'region_name': instance._region_name
    }

    murano_packages_service = \
        instance.get_configuration().get('murano_packages_service')

    if murano_packages_service == 'glare':
        glare_endpoint = instance.get_configuration().get('glare_url')
        if not glare_endpoint:
            try:
                # no glare_endpoint and we requested to store packages in glare
                # check keystone catalog
                glare_endpoint = instance.get_endpoint_for_service_type(
                    'artifact',
                    region_name=instance._region_name,
                    interface=instance._interface
                )
            except Exception:

# Path: muranoclient/apiclient/exceptions.py
# class ClientException(Exception):
# class MissingArgs(ClientException):
# class ValidationError(ClientException):
# class UnsupportedVersion(ClientException):
# class CommandError(ClientException):
# class AuthorizationFailure(ClientException):
# class ConnectionRefused(ClientException):
# class AuthPluginOptionsMissing(AuthorizationFailure):
# class AuthSystemNotFound(AuthorizationFailure):
# class NoUniqueMatch(ClientException):
# class EndpointException(ClientException):
# class EndpointNotFound(EndpointException):
# class AmbiguousEndpoints(EndpointException):
# class HttpError(ClientException):
# class HTTPRedirection(HttpError):
# class HTTPClientError(HttpError):
# class HttpServerError(HttpError):
# class MultipleChoices(HTTPRedirection):
# class BadRequest(HTTPClientError):
# class Unauthorized(HTTPClientError):
# class PaymentRequired(HTTPClientError):
# class Forbidden(HTTPClientError):
# class NotFound(HTTPClientError):
# class MethodNotAllowed(HTTPClientError):
# class NotAcceptable(HTTPClientError):
# class ProxyAuthenticationRequired(HTTPClientError):
# class RequestTimeout(HTTPClientError):
# class Conflict(HTTPClientError):
# class Gone(HTTPClientError):
# class LengthRequired(HTTPClientError):
# class PreconditionFailed(HTTPClientError):
# class RequestEntityTooLarge(HTTPClientError):
# class RequestUriTooLong(HTTPClientError):
# class UnsupportedMediaType(HTTPClientError):
# class RequestedRangeNotSatisfiable(HTTPClientError):
# class ExpectationFailed(HTTPClientError):
# class UnprocessableEntity(HTTPClientError):
# class InternalServerError(HttpServerError):
# class HttpNotImplemented(HttpServerError):
# class BadGateway(HttpServerError):
# class ServiceUnavailable(HttpServerError):
# class GatewayTimeout(HttpServerError):
# class HttpVersionNotSupported(HttpServerError):
#     def __init__(self, missing):
#     def __init__(self, opt_names):
#     def __init__(self, auth_system):
#     def __init__(self, endpoints=None):
#     def __init__(self, message=None, details=None,
#                  response=None, request_id=None,
#                  url=None, method=None, http_status=None):
#     def __init__(self, *args, **kwargs):
# def from_response(response, url, method):
# 
# Path: muranoclient/glance/client.py
# class Client(object):
#     def __init__(self, endpoint, type_name, type_version, **kwargs):
# 
# Path: muranoclient/i18n.py



# Path: muranoclient/osc/plugin.py
from osc_lib import utils
from oslo_log import log as logging
from muranoclient.apiclient import exceptions as exc
from muranoclient.glance import client as art_client
from muranoclient.i18n import _

def make_client(instance):
    """Returns an application-catalog service client"""
    application_catalog_client = utils.get_client_class(
        API_NAME,
        instance._api_version[API_NAME],
        API_VERSIONS)
    LOG.debug("Instantiating application-catalog client: {0}".format(
              application_catalog_client))

    kwargs = {
        'session': instance.session,
        'service_type': 'application-catalog',
        'region_name': instance._region_name
    }

    murano_packages_service = \
        instance.get_configuration().get('murano_packages_service')

    if murano_packages_service == 'glare':
        glare_endpoint = instance.get_configuration().get('glare_url')
        if not glare_endpoint:
            try:
                # no glare_endpoint and we requested to store packages in glare
                # check keystone catalog
                glare_endpoint = instance.get_endpoint_for_service_type(
                    'artifact',
                    region_name=instance._region_name,
                    interface=instance._interface
                )
            except Exception:

                raise exc.CommandError(