# Path: tackerclient/common/exceptions.py
# class TackerException(Exception):
# class TackerClientException(TackerException):
# class BadRequest(TackerClientException):
# class Unauthorized(TackerClientException):
# class Forbidden(TackerClientException):
# class NotFound(TackerClientException):
# class Conflict(TackerClientException):
# class InternalServerError(TackerClientException):
# class ServiceUnavailable(TackerClientException):
# class NetworkNotFoundClient(NotFound):
# class PortNotFoundClient(NotFound):
# class StateInvalidClient(BadRequest):
# class NetworkInUseClient(Conflict):
# class PortInUseClient(Conflict):
# class IpAddressInUseClient(Conflict):
# class InvalidIpForNetworkClient(BadRequest):
# class OverQuotaClient(Conflict):
# class IpAddressGenerationFailureClient(Conflict):
# class MacAddressInUseClient(Conflict):
# class ExternalIpAddressExhaustedClient(BadRequest):
# class NoAuthURLProvided(Unauthorized):
# class EndpointNotFound(TackerClientException):
# class EndpointTypeNotFound(TackerClientException):
# class AmbiguousEndpoints(TackerClientException):
# class RequestURITooLong(TackerClientException):
# class ConnectionFailed(TackerClientException):
# class SslCertificateValidationError(TackerClientException):
# class MalformedResponseBody(TackerClientException):
# class InvalidContentType(TackerClientException):
# class InvalidInput(TackerClientException):
# class UnsupportedCommandVersion(TackerClientException):
# class TackerCLIError(TackerException):
# class CommandError(TackerCLIError):
# class UnsupportedVersion(TackerCLIError):
# class TackerClientNoUniqueMatch(TackerCLIError):
#     def __init__(self, message=None, **kwargs):
#     def __str__(self):
#     def __init__(self, message=None, **kwargs):
#     def __init__(self, **kwargs):
# HTTP_EXCEPTION_MAP = {
#     400: BadRequest,
#     401: Unauthorized,
#     403: Forbidden,
#     404: NotFound,
#     409: Conflict,
#     500: InternalServerError,
#     503: ServiceUnavailable,
# }


import json
import logging
import os
import time
from osc_lib.command import command
from osc_lib import utils
from tackerclient.common import exceptions
from tackerclient.i18n import _
from tackerclient.osc import sdk_utils
from tackerclient.osc import utils as tacker_osc_utils
            columns, mixed_case_fields=_mixed_case_fields,
            formatters=formatters)
        return (display_columns, data)


class ListVnfLcm(command.Lister):
    _description = _("List VNF Instance")

    def get_parser(self, prog_name):
        parser = super(ListVnfLcm, self).get_parser(prog_name)
        return parser

    def take_action(self, parsed_args):
        _params = {}
        client = self.app.client_manager.tackerclient
        vnf_instances = client.list_vnf_instances(**_params)
        headers, columns = tacker_osc_utils.get_column_definitions(
            _attr_map, long_listing=True)
        return (headers,
                (utils.get_dict_properties(
                    s, columns, mixed_case_fields=_mixed_case_fields,
                ) for s in vnf_instances))


def jsonfile2body(file_path):

    if file_path is not None and os.access(file_path, os.R_OK) is False:
        msg = _("File %s does not exist or user does not have read "
                "privileges to it")
        reason = msg % file_path

# Path: tackerclient/common/exceptions.py
# class TackerException(Exception):
# class TackerClientException(TackerException):
# class BadRequest(TackerClientException):
# class Unauthorized(TackerClientException):
# class Forbidden(TackerClientException):
# class NotFound(TackerClientException):
# class Conflict(TackerClientException):
# class InternalServerError(TackerClientException):
# class ServiceUnavailable(TackerClientException):
# class NetworkNotFoundClient(NotFound):
# class PortNotFoundClient(NotFound):
# class StateInvalidClient(BadRequest):
# class NetworkInUseClient(Conflict):
# class PortInUseClient(Conflict):
# class IpAddressInUseClient(Conflict):
# class InvalidIpForNetworkClient(BadRequest):
# class OverQuotaClient(Conflict):
# class IpAddressGenerationFailureClient(Conflict):
# class MacAddressInUseClient(Conflict):
# class ExternalIpAddressExhaustedClient(BadRequest):
# class NoAuthURLProvided(Unauthorized):
# class EndpointNotFound(TackerClientException):
# class EndpointTypeNotFound(TackerClientException):
# class AmbiguousEndpoints(TackerClientException):
# class RequestURITooLong(TackerClientException):
# class ConnectionFailed(TackerClientException):
# class SslCertificateValidationError(TackerClientException):
# class MalformedResponseBody(TackerClientException):
# class InvalidContentType(TackerClientException):
# class InvalidInput(TackerClientException):
# class UnsupportedCommandVersion(TackerClientException):
# class TackerCLIError(TackerException):
# class CommandError(TackerCLIError):
# class UnsupportedVersion(TackerCLIError):
# class TackerClientNoUniqueMatch(TackerCLIError):
#     def __init__(self, message=None, **kwargs):
#     def __str__(self):
#     def __init__(self, message=None, **kwargs):
#     def __init__(self, **kwargs):
# HTTP_EXCEPTION_MAP = {
#     400: BadRequest,
#     401: Unauthorized,
#     403: Forbidden,
#     404: NotFound,
#     409: Conflict,
#     500: InternalServerError,
#     503: ServiceUnavailable,
# }


# Path: tackerclient/osc/v1/vnflcm/vnflcm.py
import json
import logging
import os
import time
from osc_lib.command import command
from osc_lib import utils
from tackerclient.common import exceptions
from tackerclient.i18n import _
from tackerclient.osc import sdk_utils
from tackerclient.osc import utils as tacker_osc_utils

            columns, mixed_case_fields=_mixed_case_fields,
            formatters=formatters)
        return (display_columns, data)


class ListVnfLcm(command.Lister):
    _description = _("List VNF Instance")

    def get_parser(self, prog_name):
        parser = super(ListVnfLcm, self).get_parser(prog_name)
        return parser

    def take_action(self, parsed_args):
        _params = {}
        client = self.app.client_manager.tackerclient
        vnf_instances = client.list_vnf_instances(**_params)
        headers, columns = tacker_osc_utils.get_column_definitions(
            _attr_map, long_listing=True)
        return (headers,
                (utils.get_dict_properties(
                    s, columns, mixed_case_fields=_mixed_case_fields,
                ) for s in vnf_instances))


def jsonfile2body(file_path):

    if file_path is not None and os.access(file_path, os.R_OK) is False:
        msg = _("File %s does not exist or user does not have read "
                "privileges to it")
        reason = msg % file_path

        raise exceptions.InvalidInput(reason=reason)