summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-25 01:40:53 +0000
committerGerrit Code Review <review@openstack.org>2013-06-25 01:40:53 +0000
commit24129187ed642f99e6085f8bd44da5a9eb39034f (patch)
treeb39c1b5eaee0ae616a65b753d0e323d7eaefdc2d
parent771254b3a89e5f173896560d46489e6594be45e1 (diff)
parentc9bb51c6da93a40f4057e99db146c109718bc3a6 (diff)
downloadnova-24129187ed642f99e6085f8bd44da5a9eb39034f.tar.gz
nova-24129187ed642f99e6085f8bd44da5a9eb39034f.tar.xz
nova-24129187ed642f99e6085f8bd44da5a9eb39034f.zip
Merge "Revert XenApi virt driver should throw exception"
-rw-r--r--nova/tests/virt/xenapi/test_vmops.py11
-rw-r--r--nova/tests/virt/xenapi/test_xenapi.py5
-rw-r--r--nova/virt/xenapi/vmops.py6
3 files changed, 1 insertions, 21 deletions
diff --git a/nova/tests/virt/xenapi/test_vmops.py b/nova/tests/virt/xenapi/test_vmops.py
index d2b5477eb..674d84882 100644
--- a/nova/tests/virt/xenapi/test_vmops.py
+++ b/nova/tests/virt/xenapi/test_vmops.py
@@ -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):
diff --git a/nova/tests/virt/xenapi/test_xenapi.py b/nova/tests/virt/xenapi/test_xenapi.py
index 30e75d95a..f6ff23aba 100644
--- a/nova/tests/virt/xenapi/test_xenapi.py
+++ b/nova/tests/virt/xenapi/test_xenapi.py
@@ -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()
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index d18fc2729..80a4fb48a 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -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)