diff --git a/compute_hyperv/nova/vmops.py b/compute_hyperv/nova/vmops.py index 197d8b7d..de32baa2 100644 --- a/compute_hyperv/nova/vmops.py +++ b/compute_hyperv/nova/vmops.py @@ -823,7 +823,7 @@ class VMOps(object): self.power_off(instance) self._vmutils.destroy_vm(instance_name) elif self._migrutils.planned_vm_exists(instance_name): - self._migrutils.destroy_planned_vm(instance_name) + self._migrutils.destroy_existing_planned_vm(instance_name) else: LOG.debug("Instance not found", instance=instance) diff --git a/compute_hyperv/tests/unit/test_vmops.py b/compute_hyperv/tests/unit/test_vmops.py index ac27faeb..ac7bbe76 100644 --- a/compute_hyperv/tests/unit/test_vmops.py +++ b/compute_hyperv/tests/unit/test_vmops.py @@ -1256,11 +1256,14 @@ class VMOpsTestCase(test_base.HyperVBaseTestCase): elif planned_vm_exists: self._vmops._migrutils.planned_vm_exists.assert_called_once_with( mock_instance.name) - self._vmops._migrutils.destroy_planned_vm.assert_called_once_with( + destroy_planned_vm = ( + self._vmops._migrutils.destroy_existing_planned_vm) + destroy_planned_vm.assert_called_once_with( mock_instance.name) self.assertFalse(self._vmops._vmutils.destroy_vm.called) else: - self.assertFalse(self._vmops._migrutils.destroy_planned_vm.called) + self.assertFalse( + self._vmops._migrutils.destroy_existing_planned_vm.called) mock_unplug_vifs.assert_called_once_with( mock_instance, mock.sentinel.fake_network_info)