From 8ac7846ee85c0d543a4333e2b0652c820a6e2bc3 Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Mon, 12 Dec 2011 18:01:54 +0000 Subject: [PATCH] Make XenAPI agent configuration synchronous Fixes bug 897887 Much of the XenAPI agent configuration happens asynchronously from the spawn process. This allows the instance to go ACTIVE state earlier and leaves the possibility of a race with delete open. This makes the steps synchronous, ensuring the process only goes to ACTIVE after the configuration is done. Change-Id: I294b595128979e153c797d9e610b66bc76f47666 --- nova/tests/test_xenapi.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index f0bc8c85f..eecbc82b8 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -188,7 +188,7 @@ class XenAPIVolumeTestCase(test.TestCase): self.stubs.UnsetAll() -def reset_network(*args): +def configure_instance(*args): pass @@ -214,7 +214,8 @@ class XenAPIVMTestCase(test.TestCase): stubs.stubout_get_this_vm_uuid(self.stubs) stubs.stubout_stream_disk(self.stubs) stubs.stubout_is_vdi_pv(self.stubs) - self.stubs.Set(vmops.VMOps, 'reset_network', reset_network) + self.stubs.Set(vmops.VMOps, '_configure_instance', + configure_instance) self.stubs.Set(vmops.VMOps, '_find_rescue_vbd_ref', _find_rescue_vbd_ref) stubs.stub_out_vm_methods(self.stubs)