Deprecate unused exceptions
Deprecate the following unused exceptions: * VMwareDriverConfigurationException * UseLinkedCloneConfigurationFault * MissingParameter The above exceptions are specific to VMware Nova driver and should be moved to Nova code base. Change-Id: I74482d6ac436fbea4383a197f24704bc3d033076
This commit is contained in:
		@@ -21,7 +21,7 @@ import logging
 | 
			
		||||
 | 
			
		||||
import six
 | 
			
		||||
 | 
			
		||||
from oslo_vmware._i18n import _, _LE
 | 
			
		||||
from oslo_vmware._i18n import _, _LE, _LW
 | 
			
		||||
 | 
			
		||||
LOG = logging.getLogger(__name__)
 | 
			
		||||
 | 
			
		||||
@@ -165,11 +165,21 @@ class ImageTransferException(VMwareDriverException):
 | 
			
		||||
        self.cause = cause
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def _print_deprecation_warning(clazz):
 | 
			
		||||
    LOG.warn(_LW("Exception %s is deprecated, it will be removed in the "
 | 
			
		||||
                 "next release."), clazz.__name__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class VMwareDriverConfigurationException(VMwareDriverException):
 | 
			
		||||
    """Base class for all configuration exceptions.
 | 
			
		||||
    """
 | 
			
		||||
    msg_fmt = _("VMware Driver configuration fault.")
 | 
			
		||||
 | 
			
		||||
    def __init__(self, message=None, details=None, **kwargs):
 | 
			
		||||
        super(VMwareDriverConfigurationException, self).__init__(
 | 
			
		||||
            message, details, **kwargs)
 | 
			
		||||
        _print_deprecation_warning(self.__class__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class UseLinkedCloneConfigurationFault(VMwareDriverConfigurationException):
 | 
			
		||||
    msg_fmt = _("No default value for use_linked_clone found.")
 | 
			
		||||
@@ -178,6 +188,10 @@ class UseLinkedCloneConfigurationFault(VMwareDriverConfigurationException):
 | 
			
		||||
class MissingParameter(VMwareDriverException):
 | 
			
		||||
    msg_fmt = _("Missing parameter : %(param)s")
 | 
			
		||||
 | 
			
		||||
    def __init__(self, message=None, details=None, **kwargs):
 | 
			
		||||
        super(MissingParameter, self).__init__(message, details, **kwargs)
 | 
			
		||||
        _print_deprecation_warning(self.__class__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class AlreadyExistsException(VimException):
 | 
			
		||||
    msg_fmt = _("Resource already exists.")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user