Merge "Remove unused migrate_data kwarg from virt driver destroy() method"

This commit is contained in:
Jenkins 2017-05-30 17:42:20 +00:00 committed by Gerrit Code Review
commit 365a66204e
10 changed files with 12 additions and 18 deletions

View File

@ -162,7 +162,7 @@ class HyperVDriverTestCase(test_base.HyperVBaseTestCase):
self.driver.destroy(
mock.sentinel.context, mock.sentinel.instance,
mock.sentinel.network_info, mock.sentinel.block_device_info,
mock.sentinel.destroy_disks, mock.sentinel.migrate_data)
mock.sentinel.destroy_disks)
self.driver._vmops.destroy.assert_called_once_with(
mock.sentinel.instance, mock.sentinel.network_info,

View File

@ -11478,8 +11478,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
mock_domain_destroy.assert_called_once_with()
mock_teardown_container.assert_called_once_with(instance)
mock_cleanup.assert_called_once_with(self.context, instance,
network_info, None, False,
None)
network_info, None, False)
@mock.patch.object(libvirt_driver.LibvirtDriver, 'cleanup')
@mock.patch.object(libvirt_driver.LibvirtDriver, '_teardown_container')
@ -11499,8 +11498,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
mock.call(instance)])
mock_teardown_container.assert_called_once_with(instance)
mock_cleanup.assert_called_once_with(self.context, instance,
network_info, None, False,
None)
network_info, None, False)
def test_reboot_different_ids(self):
class FakeLoopingCall(object):

View File

@ -287,7 +287,7 @@ class ComputeDriver(object):
raise NotImplementedError()
def destroy(self, context, instance, network_info, block_device_info=None,
destroy_disks=True, migrate_data=None):
destroy_disks=True):
"""Destroy the specified instance from the Hypervisor.
If the instance is not found (for example if networking failed), this
@ -300,7 +300,6 @@ class ComputeDriver(object):
:param block_device_info: Information about block devices that should
be detached from the instance.
:param destroy_disks: Indicates if disks should be destroyed
:param migrate_data: implementation specific params
"""
raise NotImplementedError()

View File

@ -264,7 +264,7 @@ class FakeDriver(driver.ComputeDriver):
pass
def destroy(self, context, instance, network_info, block_device_info=None,
destroy_disks=True, migrate_data=None):
destroy_disks=True):
key = instance.uuid
if key in self.instances:
flavor = instance.flavor

View File

@ -158,7 +158,7 @@ class HyperVDriver(driver.ComputeDriver):
self._vmops.reboot(instance, network_info, reboot_type)
def destroy(self, context, instance, network_info, block_device_info=None,
destroy_disks=True, migrate_data=None):
destroy_disks=True):
self._vmops.destroy(instance, network_info, block_device_info,
destroy_disks)

View File

@ -1024,7 +1024,7 @@ class IronicDriver(virt_driver.ComputeDriver):
timer.start(interval=CONF.ironic.api_retry_interval).wait()
def destroy(self, context, instance, network_info,
block_device_info=None, destroy_disks=True, migrate_data=None):
block_device_info=None, destroy_disks=True):
"""Destroy the specified instance, if it can be found.
:param context: The security context.
@ -1034,8 +1034,6 @@ class IronicDriver(virt_driver.ComputeDriver):
information. Ignored by this driver.
:param destroy_disks: Indicates if disks should be
destroyed. Ignored by this driver.
:param migrate_data: implementation specific params.
Ignored by this driver.
"""
LOG.debug('Destroy called for instance', instance=instance)
try:

View File

@ -899,10 +899,10 @@ class LibvirtDriver(driver.ComputeDriver):
self._teardown_container(instance)
def destroy(self, context, instance, network_info, block_device_info=None,
destroy_disks=True, migrate_data=None):
destroy_disks=True):
self._destroy(instance)
self.cleanup(context, instance, network_info, block_device_info,
destroy_disks, migrate_data)
destroy_disks)
def _undefine_domain(self, instance):
try:

View File

@ -167,7 +167,7 @@ class PowerVMDriver(driver.ComputeDriver):
tf_base.run(flow_spawn, instance=instance)
def destroy(self, context, instance, network_info, block_device_info=None,
destroy_disks=True, migrate_data=None):
destroy_disks=True):
"""Destroy the specified instance from the Hypervisor.
If the instance is not found (for example if networking failed), this
@ -180,7 +180,6 @@ class PowerVMDriver(driver.ComputeDriver):
:param block_device_info: Information about block devices that should
be detached from the instance.
:param destroy_disks: Indicates if disks should be destroyed
:param migrate_data: implementation specific params
"""
# TODO(thorst, efried) Add resize checks for destroy
self._log_operation('destroy', instance)

View File

@ -377,7 +377,7 @@ class VMwareVCDriver(driver.ComputeDriver):
instance=instance)
def destroy(self, context, instance, network_info, block_device_info=None,
destroy_disks=True, migrate_data=None):
destroy_disks=True):
"""Destroy VM instance."""
# Destroy gets triggered when Resource Claim in resource_tracker

View File

@ -222,7 +222,7 @@ class XenAPIDriver(driver.ComputeDriver):
self._vmops.change_instance_metadata(instance, diff)
def destroy(self, context, instance, network_info, block_device_info=None,
destroy_disks=True, migrate_data=None):
destroy_disks=True):
"""Destroy VM instance."""
self._vmops.destroy(instance, network_info, block_device_info,
destroy_disks)