Fixes vmops destroy planned VM call

vmops' destroy method calls the wrong method "destroy_planned_vm"
instead of "destroy_existing_planned_vm".

Change-Id: I1f2f495bf55921a2322e71e224ed67990db4a02e
This commit is contained in:
Claudiu Belu 2017-09-01 19:48:04 +03:00
parent 6e715ed580
commit bd12ddf55e
2 changed files with 6 additions and 3 deletions

View File

@ -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)

View File

@ -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)