diff options
| author | matt.dietz@rackspace.com <> | 2011-08-03 17:39:51 -0500 |
|---|---|---|
| committer | matt.dietz@rackspace.com <> | 2011-08-03 17:39:51 -0500 |
| commit | bd0a2ed74764de262a828fd086fa0e08493b2cec (patch) | |
| tree | e14516aa2b7e8e6fa7bfa558dc1b6d3d460301ba | |
| parent | e2770a4558c95aa4b6e276ebe18dc580a82e6d67 (diff) | |
| download | nova-bd0a2ed74764de262a828fd086fa0e08493b2cec.tar.gz nova-bd0a2ed74764de262a828fd086fa0e08493b2cec.tar.xz nova-bd0a2ed74764de262a828fd086fa0e08493b2cec.zip | |
Fixes lp819397
| -rw-r--r-- | nova/tests/test_xenapi.py | 7 | ||||
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index a795b3c74..26a36b231 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -754,12 +754,18 @@ class XenAPIMigrateInstance(test.TestCase): def test_finish_migrate(self): instance = db.instance_create(self.context, self.values) self.called = False + self.fake_vm_start_called = False + + def fake_vm_start(*args, **kwargs): + self.fake_vm_start_called = True def fake_vdi_resize(*args, **kwargs): self.called = True self.stubs.Set(stubs.FakeSessionForMigrationTests, "VDI_resize_online", fake_vdi_resize) + self.stubs.Set(vmops.VMOps, '_start', fake_vm_start) + stubs.stubout_session(self.stubs, stubs.FakeSessionForMigrationTests) stubs.stubout_loopingcall_start(self.stubs) conn = xenapi_conn.get_connection(False) @@ -781,6 +787,7 @@ class XenAPIMigrateInstance(test.TestCase): dict(base_copy='hurr', cow='durr'), network_info, resize_instance=True) self.assertEqual(self.called, True) + self.assertEqual(self.fake_vm_start_called, True) def test_finish_migrate_no_local_storage(self): tiny_type_id = \ diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index b3b812a48..3b9f35034 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -122,7 +122,7 @@ class VMOps(object): network_info) if resize_instance: self.resize_instance(instance, vdi_uuid) - self._spawn(instance, vm_ref) + self._start(instance, vm_ref=vm_ref) def _start(self, instance, vm_ref=None): """Power on a VM instance""" |
