Remove unused migrate_data kwarg from virt driver destroy() method
The migrate_data kwarg was added to the virt driver destroy()
method in change bc45c56f10
but
was never actually used, i.e. nothing passes migrate_data to
the destroy() method. The compute manager passes migrate_data to
the cleanup() method. This change just removes the unused kwarg
so it's not confusing for new virt drivers like powervm.
Change-Id: I6cca3b5ddd387dac86750be70f49c764a1be2fca
This commit is contained in:
parent
0d3003405d
commit
aac07e1f01
|
@ -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,
|
||||
|
|
|
@ -11430,8 +11430,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')
|
||||
|
@ -11451,8 +11450,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):
|
||||
|
|
|
@ -288,7 +288,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
|
||||
|
@ -301,7 +301,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()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -900,10 +900,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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue