Skip to content

Commit

Permalink
mark vif_driver as deprecated and log warning
Browse files Browse the repository at this point in the history
Several classes were dropped from nova.virt.libvirt.vif from havana ->
icehouse, leading to invalid configurations if one of these classes was
used in the libvirt_vif_driver setting in nova.conf.  The error message
produced by nova-compute in this situation is misleading.

This patch introduces stubs for all of the classes that were removed.
These stubs inherit from LibvirtGenericVIFDriver and log a deprecation
warning in __init__.

This patch also marks the vif_driver option as deprecated.

Change-Id: I6d6cb9315ce6f3b33d17756bcdc77dccda26fefe
Closed-bug: 1302796
(cherry picked from commit 9f6070e)
  • Loading branch information
larsks authored and kk7ds committed Apr 7, 2014
1 parent bdd064f commit fdffaab
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nova/virt/libvirt/driver.py
Expand Up @@ -183,7 +183,9 @@
deprecated_group='DEFAULT'),
cfg.StrOpt('vif_driver',
default='nova.virt.libvirt.vif.LibvirtGenericVIFDriver',
help='The libvirt VIF driver to configure the VIFs.',
help='DEPRECATED. The libvirt VIF driver to configure the VIFs.'
'This option is deprecated and will be removed in the '
'Juno release.',
deprecated_name='libvirt_vif_driver',
deprecated_group='DEFAULT'),
cfg.ListOpt('volume_drivers',
Expand Down
33 changes: 33 additions & 0 deletions nova/virt/libvirt/vif.py
Expand Up @@ -796,3 +796,36 @@ def unplug(self, instance, vif):
else:
raise exception.NovaException(
_("Unexpected vif_type=%s") % vif_type)

# The following classes were removed in the transition from Havana to
# Icehouse, but may still be referenced in configuration files. The
# following stubs allow those configurations to work while logging a
# deprecation warning.


class _LibvirtDeprecatedDriver(LibvirtGenericVIFDriver):
def __init__(self, *args, **kwargs):
LOG.warn('VIF driver \"%s\" is marked as deprecated and will be '
'removed in the Juno release.',
self.__class__.__name__)
super(_LibvirtDeprecatedDriver, self).__init__(*args, **kwargs)


class LibvirtBridgeDriver(_LibvirtDeprecatedDriver):
pass


class LibvirtOpenVswitchDriver(_LibvirtDeprecatedDriver):
pass


class LibvirtHybridOVSBridgeDriver(_LibvirtDeprecatedDriver):
pass


class LibvirtOpenVswitchVirtualPortDriver(_LibvirtDeprecatedDriver):
pass


class NeutronLinuxBridgeVIFDriver(_LibvirtDeprecatedDriver):
pass

0 comments on commit fdffaab

Please sign in to comment.