Merge "Remove unused migrate_data kwarg from virt driver destroy() method"
This commit is contained in:
commit
365a66204e
|
@ -162,7 +162,7 @@ class HyperVDriverTestCase(test_base.HyperVBaseTestCase):
|
||||||
self.driver.destroy(
|
self.driver.destroy(
|
||||||
mock.sentinel.context, mock.sentinel.instance,
|
mock.sentinel.context, mock.sentinel.instance,
|
||||||
mock.sentinel.network_info, mock.sentinel.block_device_info,
|
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(
|
self.driver._vmops.destroy.assert_called_once_with(
|
||||||
mock.sentinel.instance, mock.sentinel.network_info,
|
mock.sentinel.instance, mock.sentinel.network_info,
|
||||||
|
|
|
@ -11478,8 +11478,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||||
mock_domain_destroy.assert_called_once_with()
|
mock_domain_destroy.assert_called_once_with()
|
||||||
mock_teardown_container.assert_called_once_with(instance)
|
mock_teardown_container.assert_called_once_with(instance)
|
||||||
mock_cleanup.assert_called_once_with(self.context, instance,
|
mock_cleanup.assert_called_once_with(self.context, instance,
|
||||||
network_info, None, False,
|
network_info, None, False)
|
||||||
None)
|
|
||||||
|
|
||||||
@mock.patch.object(libvirt_driver.LibvirtDriver, 'cleanup')
|
@mock.patch.object(libvirt_driver.LibvirtDriver, 'cleanup')
|
||||||
@mock.patch.object(libvirt_driver.LibvirtDriver, '_teardown_container')
|
@mock.patch.object(libvirt_driver.LibvirtDriver, '_teardown_container')
|
||||||
|
@ -11499,8 +11498,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||||
mock.call(instance)])
|
mock.call(instance)])
|
||||||
mock_teardown_container.assert_called_once_with(instance)
|
mock_teardown_container.assert_called_once_with(instance)
|
||||||
mock_cleanup.assert_called_once_with(self.context, instance,
|
mock_cleanup.assert_called_once_with(self.context, instance,
|
||||||
network_info, None, False,
|
network_info, None, False)
|
||||||
None)
|
|
||||||
|
|
||||||
def test_reboot_different_ids(self):
|
def test_reboot_different_ids(self):
|
||||||
class FakeLoopingCall(object):
|
class FakeLoopingCall(object):
|
||||||
|
|
|
@ -287,7 +287,7 @@ class ComputeDriver(object):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def destroy(self, context, instance, network_info, block_device_info=None,
|
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.
|
"""Destroy the specified instance from the Hypervisor.
|
||||||
|
|
||||||
If the instance is not found (for example if networking failed), this
|
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
|
:param block_device_info: Information about block devices that should
|
||||||
be detached from the instance.
|
be detached from the instance.
|
||||||
:param destroy_disks: Indicates if disks should be destroyed
|
:param destroy_disks: Indicates if disks should be destroyed
|
||||||
:param migrate_data: implementation specific params
|
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@ class FakeDriver(driver.ComputeDriver):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def destroy(self, context, instance, network_info, block_device_info=None,
|
def destroy(self, context, instance, network_info, block_device_info=None,
|
||||||
destroy_disks=True, migrate_data=None):
|
destroy_disks=True):
|
||||||
key = instance.uuid
|
key = instance.uuid
|
||||||
if key in self.instances:
|
if key in self.instances:
|
||||||
flavor = instance.flavor
|
flavor = instance.flavor
|
||||||
|
|
|
@ -158,7 +158,7 @@ class HyperVDriver(driver.ComputeDriver):
|
||||||
self._vmops.reboot(instance, network_info, reboot_type)
|
self._vmops.reboot(instance, network_info, reboot_type)
|
||||||
|
|
||||||
def destroy(self, context, instance, network_info, block_device_info=None,
|
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,
|
self._vmops.destroy(instance, network_info, block_device_info,
|
||||||
destroy_disks)
|
destroy_disks)
|
||||||
|
|
||||||
|
|
|
@ -1024,7 +1024,7 @@ class IronicDriver(virt_driver.ComputeDriver):
|
||||||
timer.start(interval=CONF.ironic.api_retry_interval).wait()
|
timer.start(interval=CONF.ironic.api_retry_interval).wait()
|
||||||
|
|
||||||
def destroy(self, context, instance, network_info,
|
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.
|
"""Destroy the specified instance, if it can be found.
|
||||||
|
|
||||||
:param context: The security context.
|
:param context: The security context.
|
||||||
|
@ -1034,8 +1034,6 @@ class IronicDriver(virt_driver.ComputeDriver):
|
||||||
information. Ignored by this driver.
|
information. Ignored by this driver.
|
||||||
:param destroy_disks: Indicates if disks should be
|
:param destroy_disks: Indicates if disks should be
|
||||||
destroyed. Ignored by this driver.
|
destroyed. Ignored by this driver.
|
||||||
:param migrate_data: implementation specific params.
|
|
||||||
Ignored by this driver.
|
|
||||||
"""
|
"""
|
||||||
LOG.debug('Destroy called for instance', instance=instance)
|
LOG.debug('Destroy called for instance', instance=instance)
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -899,10 +899,10 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||||
self._teardown_container(instance)
|
self._teardown_container(instance)
|
||||||
|
|
||||||
def destroy(self, context, instance, network_info, block_device_info=None,
|
def destroy(self, context, instance, network_info, block_device_info=None,
|
||||||
destroy_disks=True, migrate_data=None):
|
destroy_disks=True):
|
||||||
self._destroy(instance)
|
self._destroy(instance)
|
||||||
self.cleanup(context, instance, network_info, block_device_info,
|
self.cleanup(context, instance, network_info, block_device_info,
|
||||||
destroy_disks, migrate_data)
|
destroy_disks)
|
||||||
|
|
||||||
def _undefine_domain(self, instance):
|
def _undefine_domain(self, instance):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -167,7 +167,7 @@ class PowerVMDriver(driver.ComputeDriver):
|
||||||
tf_base.run(flow_spawn, instance=instance)
|
tf_base.run(flow_spawn, instance=instance)
|
||||||
|
|
||||||
def destroy(self, context, instance, network_info, block_device_info=None,
|
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.
|
"""Destroy the specified instance from the Hypervisor.
|
||||||
|
|
||||||
If the instance is not found (for example if networking failed), this
|
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
|
:param block_device_info: Information about block devices that should
|
||||||
be detached from the instance.
|
be detached from the instance.
|
||||||
:param destroy_disks: Indicates if disks should be destroyed
|
:param destroy_disks: Indicates if disks should be destroyed
|
||||||
:param migrate_data: implementation specific params
|
|
||||||
"""
|
"""
|
||||||
# TODO(thorst, efried) Add resize checks for destroy
|
# TODO(thorst, efried) Add resize checks for destroy
|
||||||
self._log_operation('destroy', instance)
|
self._log_operation('destroy', instance)
|
||||||
|
|
|
@ -377,7 +377,7 @@ class VMwareVCDriver(driver.ComputeDriver):
|
||||||
instance=instance)
|
instance=instance)
|
||||||
|
|
||||||
def destroy(self, context, instance, network_info, block_device_info=None,
|
def destroy(self, context, instance, network_info, block_device_info=None,
|
||||||
destroy_disks=True, migrate_data=None):
|
destroy_disks=True):
|
||||||
"""Destroy VM instance."""
|
"""Destroy VM instance."""
|
||||||
|
|
||||||
# Destroy gets triggered when Resource Claim in resource_tracker
|
# Destroy gets triggered when Resource Claim in resource_tracker
|
||||||
|
|
|
@ -222,7 +222,7 @@ class XenAPIDriver(driver.ComputeDriver):
|
||||||
self._vmops.change_instance_metadata(instance, diff)
|
self._vmops.change_instance_metadata(instance, diff)
|
||||||
|
|
||||||
def destroy(self, context, instance, network_info, block_device_info=None,
|
def destroy(self, context, instance, network_info, block_device_info=None,
|
||||||
destroy_disks=True, migrate_data=None):
|
destroy_disks=True):
|
||||||
"""Destroy VM instance."""
|
"""Destroy VM instance."""
|
||||||
self._vmops.destroy(instance, network_info, block_device_info,
|
self._vmops.destroy(instance, network_info, block_device_info,
|
||||||
destroy_disks)
|
destroy_disks)
|
||||||
|
|
Loading…
Reference in New Issue