# Path: os_vif/exception.py
# class ExceptionBase(Exception):
# class LibraryNotInitialized(ExceptionBase):
# class NoMatchingPlugin(ExceptionBase):
# class NoMatchingPortProfileClass(ExceptionBase):
# class NoSupportedPortProfileVersion(ExceptionBase):
# class NoMatchingVIFClass(ExceptionBase):
# class NoSupportedVIFVersion(ExceptionBase):
# class PlugException(ExceptionBase):
# class UnplugException(ExceptionBase):
# class NetworkMissingPhysicalNetwork(ExceptionBase):
# class NetworkInterfaceNotFound(ExceptionBase):
# class NetworkInterfaceTypeNotDefined(ExceptionBase):
# class ExternalImport(ExceptionBase):
# class NotImplementedForOS(ExceptionBase):
#     def __init__(self, message=None, **kwargs):
#     def format_message(self):
# 
# Path: os_vif/objects/base.py
# class VersionedObject(ovo_base.VersionedObject):
# class VersionedObjectPrintableMixin(object):
#     OBJ_PROJECT_NAMESPACE = 'os_vif'
#     def __str__(self):


from oslo_utils import versionutils
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
from os_vif import exception
from os_vif.objects import base as osv_base
    # Version 1.1: Adds 'supported_port_profiles' field
    VERSION = "1.1"

    fields = {
        # object name of the subclass of os_vif.objects.vif.VIFBase
        "vif_object_name": fields.StringField(),

        # String representing the earliest version of @name
        # that the plugin understands
        "min_version": fields.StringField(),

        # String representing the latest version of @name
        # that the plugin understands
        "max_version": fields.StringField(),

        # list of supported PortProfile objects and versions.
        "supported_port_profiles": fields.ListOfObjectsField(
            "HostPortProfileInfo")
    }

    def obj_make_compatible(self, primitive, target_version):
        target_version = versionutils.convert_version_to_tuple(target_version)
        if target_version < (1, 1) and 'supported_port_profiles' in primitive:
            del primitive['supported_port_profiles']
        super(HostVIFInfo, self).obj_make_compatible(primitive, '1.0')

    def get_common_version(self):
        return _get_common_version(self.vif_object_name,
                                   self.max_version,
                                   self.min_version,

# Path: os_vif/exception.py
# class ExceptionBase(Exception):
# class LibraryNotInitialized(ExceptionBase):
# class NoMatchingPlugin(ExceptionBase):
# class NoMatchingPortProfileClass(ExceptionBase):
# class NoSupportedPortProfileVersion(ExceptionBase):
# class NoMatchingVIFClass(ExceptionBase):
# class NoSupportedVIFVersion(ExceptionBase):
# class PlugException(ExceptionBase):
# class UnplugException(ExceptionBase):
# class NetworkMissingPhysicalNetwork(ExceptionBase):
# class NetworkInterfaceNotFound(ExceptionBase):
# class NetworkInterfaceTypeNotDefined(ExceptionBase):
# class ExternalImport(ExceptionBase):
# class NotImplementedForOS(ExceptionBase):
#     def __init__(self, message=None, **kwargs):
#     def format_message(self):
# 
# Path: os_vif/objects/base.py
# class VersionedObject(ovo_base.VersionedObject):
# class VersionedObjectPrintableMixin(object):
#     OBJ_PROJECT_NAMESPACE = 'os_vif'
#     def __str__(self):


# Path: os_vif/objects/host_info.py
from oslo_utils import versionutils
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
from os_vif import exception
from os_vif.objects import base as osv_base

    # Version 1.1: Adds 'supported_port_profiles' field
    VERSION = "1.1"

    fields = {
        # object name of the subclass of os_vif.objects.vif.VIFBase
        "vif_object_name": fields.StringField(),

        # String representing the earliest version of @name
        # that the plugin understands
        "min_version": fields.StringField(),

        # String representing the latest version of @name
        # that the plugin understands
        "max_version": fields.StringField(),

        # list of supported PortProfile objects and versions.
        "supported_port_profiles": fields.ListOfObjectsField(
            "HostPortProfileInfo")
    }

    def obj_make_compatible(self, primitive, target_version):
        target_version = versionutils.convert_version_to_tuple(target_version)
        if target_version < (1, 1) and 'supported_port_profiles' in primitive:
            del primitive['supported_port_profiles']
        super(HostVIFInfo, self).obj_make_compatible(primitive, '1.0')

    def get_common_version(self):
        return _get_common_version(self.vif_object_name,
                                   self.max_version,
                                   self.min_version,

                                   exception.NoMatchingVIFClass,