Merge "Revert XenApi virt driver should throw exception"
This commit is contained in:
commit
24129187ed
@ -171,17 +171,6 @@ class VMOpsTestCase(test.TestCase):
|
||||
|
||||
self.assertEqual(self.make_plugin_call_count, 1)
|
||||
|
||||
def test_destroy_raises_when_shutdown_fails(self):
|
||||
vm_ref = "vm_reference"
|
||||
fake_instance = "instance"
|
||||
|
||||
self.mox.StubOutWithMock(vm_utils, 'hard_shutdown_vm')
|
||||
vm_utils.hard_shutdown_vm(self._session, fake_instance,
|
||||
vm_ref).AndReturn(False)
|
||||
self.mox.ReplayAll()
|
||||
self.assertRaises(exception.InstancePowerOffFailure,
|
||||
self._vmops._destroy, fake_instance, vm_ref)
|
||||
|
||||
|
||||
class GetConsoleOutputTestCase(stubs.XenAPITestBase):
|
||||
def setUp(self):
|
||||
|
@ -788,11 +788,6 @@ class XenAPIVMTestCase(stubs.XenAPITestBase):
|
||||
|
||||
Verifies that the VM and VDIs created are properly cleaned up.
|
||||
"""
|
||||
def fake_hard_shutdown_vm(session, instance, vm_ref):
|
||||
return True
|
||||
|
||||
self.stubs.Set(vm_utils, 'hard_shutdown_vm',
|
||||
fake_hard_shutdown_vm)
|
||||
stubs.stubout_attach_disks(self.stubs)
|
||||
vdi_recs_start = self._list_vdis()
|
||||
start_vms = self._list_vms()
|
||||
|
@ -1253,11 +1253,7 @@ class VMOps(object):
|
||||
instance=instance)
|
||||
return
|
||||
|
||||
shutdown_success = vm_utils.hard_shutdown_vm(self._session, instance,
|
||||
vm_ref)
|
||||
if not shutdown_success:
|
||||
raise exception.InstancePowerOffFailure(
|
||||
_("XenAPI failed to power the instance off"))
|
||||
vm_utils.hard_shutdown_vm(self._session, instance, vm_ref)
|
||||
|
||||
if destroy_disks:
|
||||
self._volumeops.detach_all(vm_ref)
|
||||
|
Loading…
x
Reference in New Issue
Block a user