From 717c9755805aa06340130b6bc4e7de8f81ea8e57 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 3 Oct 2012 11:21:24 -0700 Subject: Make compute manager use nova-conductor for instance_update Several tests require changes to ensure that the conductor service is started (or set to local mode) before they ask the compute manager to do instance updates. Changes were required to some of the tests that check the value of the timestamps by converting to strings. After passing the instances through jsonutils.to_primitive(), the strings are a bit different. Change-Id: I660e471178f3e5b36c4be27d47047fb4e4e1f851 --- nova/virt/xenapi/host.py | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'nova/virt') diff --git a/nova/virt/xenapi/host.py b/nova/virt/xenapi/host.py index 8057f0542..e893abf4f 100644 --- a/nova/virt/xenapi/host.py +++ b/nova/virt/xenapi/host.py @@ -85,33 +85,27 @@ class Host(object): dest = _host_find(ctxt, self._session, aggregate[0], host_ref) - (old_ref, new_ref) = self._virtapi.instance_update( - ctxt, - instance['uuid'], - {'host': dest, - 'task_state': task_states.MIGRATING}) - notifications.send_update(ctxt, old_ref, new_ref) + self._virtapi.instance_update( + ctxt, instance['uuid'], + {'host': dest, + 'task_state': task_states.MIGRATING}) self._session.call_xenapi('VM.pool_migrate', vm_ref, host_ref, {}) migrations_counter = migrations_counter + 1 - (old_ref, new_ref) = self._virtapi.instance_update( - ctxt, - instance['uuid'], - {'vm_state': vm_states.ACTIVE}) - notifications.send_update(ctxt, old_ref, new_ref) + self._virtapi.instance_update( + ctxt, instance['uuid'], + {'vm_state': vm_states.ACTIVE}) break except self._session.XenAPI.Failure: LOG.exception(_('Unable to migrate VM %(vm_ref)s' - 'from %(host)s') % locals()) - (old_ref, new_ref) = self._virtapi.instance_update( - ctxt, - instance['uuid'], - {'host': host, - 'vm_state': vm_states.ACTIVE}) - notifications.send_update(ctxt, old_ref, new_ref) + 'from %(host)s') % locals()) + self._virtapi.instance_update( + ctxt, instance['uuid'], + {'host': host, + 'vm_state': vm_states.ACTIVE}) if vm_counter == migrations_counter: return 'on_maintenance' -- cgit